Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/109.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何进行视图转换,如系统iOS的设置?_Ios_Swift_Uitapgesturerecognizer_Uiviewanimationtransition - Fatal编程技术网

如何进行视图转换,如系统iOS的设置?

如何进行视图转换,如系统iOS的设置?,ios,swift,uitapgesturerecognizer,uiviewanimationtransition,Ios,Swift,Uitapgesturerecognizer,Uiviewanimationtransition,我有一个问题,我不知道 我想更改界面,如设置: 我甚至不知道在互联网上搜索它的关键词 我使用了交互转换和手势交互等。。。但我找不到正确的答案或演示或代码 你能告诉我如何编写代码来更改界面,比如系统iOS的设置吗?也许是一个教程。。。?多谢各位 PS:我是通过uiviewcontroller而不是uinavigationController创建这两个视图的,它被称为InteractivePopgestureRecognitor self.navigationController?.interact

我有一个问题,我不知道

我想更改界面,如设置:

我甚至不知道在互联网上搜索它的关键词

我使用了交互转换和手势交互等。。。但我找不到正确的答案或演示或代码

你能告诉我如何编写代码来更改界面,比如系统iOS的设置吗?也许是一个教程。。。?多谢各位

PS:我是通过uiviewcontroller而不是uinavigationController创建这两个视图的,它被称为InteractivePopgestureRecognitor

self.navigationController?.interactiveepogesturerecognizer?.delegate=self self.navigationController?.interactiveepogesturerecognizer?.enabled=true

将这些行放在ViewController类中,并将UIgestureRecognitizerDelegate添加到类中

class ViewControllerClass : UIViewController, UIGestureRecognizerDelegate {
// class methods
}
您还可以实现委托方法

func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool {
    return true
}

func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailByGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool {
    return (gestureRecognizer is UIScreenEdgePanGestureRecognizer)
}

我有我的答案,我把它推到那里,因为我认为这可能会帮助其他初学者

1我嵌入了视图的导航栏中

2在1之后,我们可以使用

let secondViewController = self.storyboard!.instantiateViewControllerWithIdentifier("Your view") as! LoginViewController

        self.navigationController!.pushViewController(secondViewController, animated: true)

3在第二个视图中,将有一个Backfitten automatic,我们可以执行系统iOS的类似设置

谢谢您的回答,我有两个视图:类ViewController:UIViewController、UIExtFieldDelegate、UIExtViewDelegate和类LoginViewController:UIViewController、UIExtFieldDelegate、UIgestureRecogenerDelegate,在类ViewController中有一个显示类LoginViewController的按钮,我按照你说的做了:我在类LoginViewController中添加了你的代码,但它不起作用…首先,检查您的navigationController是否为非nil,并尝试添加此行self.navigationController?.InteractiveProgestureRecognizer?.enabled=true默认值为true,但添加它以确保一切正常。如果您提供这两个控制器的代码也很好谢谢您的回答,我不知道如何检查navigationController是否为null…但我认为它为null,因为这两个视图是UIViewController,我从来没有在类中通过代码定义navigationController…我只是在XIB中添加了一个navigationController…那么我应该怎么做呢?非常感谢。我尝试了你的代码,但它不起作用…我想因为navigationController为null,如何在UIViewController类中为navigationController赋值?谢谢我用uiviewcontroller创建了两个视图,而不是uinavigationController。要实现此效果,需要uinavigationController和uiviewcontroller