jjzjj

presentviewcontroller

全部标签

ios - UIStoryboardSegue 与 presentviewcontroller?

有人可以解释使用UIStoryboardSeguemodal与以编程方式使用presentViewController之间的区别吗?使用UIStoryboardSegue只是为了方便?或者有一些性能优势?谢谢 最佳答案 在性能方面没有真正的区别。主要区别在于创建新ViewController的位置。通过Storyboardsegue,对象在呈现之前从Storyboard中取消存档。在代码中,您必须创建新的ViewController,例如...ModalViewController*modal=[[ModalViewControll

ios - presentViewController 黑色背景而不是透明

我有一个View,希望以标准方式(从屏幕底部向上滑动)呈现给用户。这个View的大约一半是透明背景,下半部分有一些输入字段(想象键盘弹出的方式)。当我在rootViewController上调用[selfpresentViewController]时,它向上滑动View,但大约半秒后,View过去是透明的,它被替换为黑色。presentViewController和presentModalViewController都会发生这种情况。如何改变这种行为? 最佳答案 这是可能的,rockybalboa在raywenderlich.com

ios - Swift Bridging-Header Objective-C presentViewController

我正在尝试使用仅在Objective-C中可用的ViewController。我已经设置了我的Bridging-Header,但是当我运行我的方法时,它不包含presentViewController并给出错误Novisible@interfacefor'AlertSelector'declarestheselector'presentViewController...'.m#import"AlertSelector.h"@implementationAlertSelector:NSObject-(void)someMethod{NSLog(@"SomeMethodRan");UIAl

swift - presentViewController 没有 navigationController swift

我到下一个View的过渡是这样的:ifletnavigationController=navigationController{ifletstoryboard:UIStoryboard=UIStoryboard(name:"myStoryboard",bundle:nil){ifletvc=storyboard.instantiateViewControllerWithIdentifier("myViewController")as?MyViewController{dispatch_async(dispatch_get_main_queue()){navigationControll

ios - 为什么在 presentviewcontroller 处于警报状态后 popviewcontroller 不工作?

//Eventcreatedalertletalert=UIAlertController(title:"EventCreated",message:"Eventsuccessfullycreated",preferredStyle:UIAlertControllerStyle.Alert);alert.addAction(UIAlertAction(title:"OK",style:UIAlertActionStyle.Default,handler:nil));self.presentViewController(alert,animated:true,completion:nil

uiviewcontroller - Swift presentViewController 没有导航栏

我正在使用以下方法在我的应用中更改场景:varview2:MainTableViewController=self.storyboard.instantiateViewControllerWithIdentifier("view2")asMainTableViewControllerself.presentViewController(view2,animated:true,completion:nil)它工作正常,但问题是在我的第一个View中我有一个导航栏,但是当我显示第二个View时没有导航栏 最佳答案 如果您需要处理不同的V

swift - 在 Swift 中使用 PresentViewController 传递变量

我正在开发一个swift应用程序,我已经使用presentViewController创建了指向其他View的链接,但我不知道如何传递变量。如何将变量传递给新View?@IBActionfuncWorkoutPressed(sender:AnyObject){letstoryBoard=UIStoryboard(name:"Main",bundle:nil)letworkoutView=storyBoard.instantiateViewControllerWithIdentifier("workoutView")asWorkoutViewControllerself.presentV

iphone - 当我们执行 presentViewController 时,幕后会发生什么?

给出下面的代码self.view.backgroundColor=[UIColoryellowColor];MyViewController*myVC=[[MyViewControlleralloc]initWithNibName:@"MyView"bundle:nil]myVC.view.backgroundColor=[UIColorclearColor];myVC.modalPresentationStyle=UIModalPresentationFullScreen;[selfpresentViewController:myVCanimated:NOcompletion:nil

ios - 从 UIView 使用 presentViewController

我正在为我的iOS应用程序创建一个标题栏,我正在UIView中创建它。我遇到的唯一问题是“主页按钮”。当按下home键时,需要跳转到首页,也就是ViewController。但是,它看起来不像[selfpresentViewController:vcanimated:NOcompletion:NULL];适用于UIView。我该如何解决这个问题?-(void)createTitlebar{CGRecttitleBarFrame=CGRectMake(0,0,320,55);//Createthehomebuttononthetoprightofthepage.Whenclicked,i

ios - UITableView 和 presentViewController 需要点击 2 次才能显示

我正在使用UITableView来呈现各种ViewController。根据点击哪个索引,它会呈现一个不同的ViewController,然后可以将其关闭。出于某种原因,我的一个ViewControllers需要两次点击才能显示。因此,似乎每隔一次点击都有效。其他View演示工作正常,所以表格可能没问题。我在即将显示的ViewController中看到的是,在第一次单击时,它通过didSelectRowAtIndexPath进行,然后在目标View中触发:ViewWillLoad、ViewLoaded、ViewWillAppear....但不是ViewDidAppear。第二次单击时,