草庐IT

UiviewController

全部标签

ios - 应用程序启动时在其他 View Controller 之上显示 View Controller 在 ios8 中不起作用

我使用以下代码:-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions{...window.rootViewController=self.viewController;[windowmakeKeyAndVisible];if(self.requireLogin){[self.viewControllerpresentViewController:self.loginViewControlleranimated:NOcompletio

ios - 将 MvvmCross 与 UIPageViewController 一起使用

是否可以将UIPageViewController(iOS)与MvvmCross一起使用?我已经将两者与Xamarin一起使用,但我现在正尝试将它与MvvmCross一起使用。我基本上到了需要设置UIPageViewControllerDataSource的地步,这需要我重写这些方法:publicoverrideUIViewControllerGetNextViewController(UIPageViewControllerpageViewController,UIViewControllerreferenceViewController)publicoverrideUIViewCo

ios - 当不再显示 UIViewController 时如何继续 CAKeyframeAnimation?

我正在使用以下代码开始基本动画(遵循路径的UIImageView):CAKeyframeAnimation*bounceAnimation=[CAKeyframeAnimationanimationWithKeyPath:@"position"];bounceAnimation.path=cgpath;bounceAnimation.duration=40.0;bounceAnimation.rotationMode=kCAAnimationRotateAuto;[img.layeraddAnimation:bounceAnimationforKey:@"animateLayer"];

ios - 自定义模式呈现忽略 preferredInterfaceOrientationForPresentation

我正在使用iOS8的UIPresentationController编写自定义模式演示文稿。呈现的Controller具有首选界面方向UIInterfaceOrientationLandscapeLeft。在使用UIPresentationController呈现此Controller时,它以纵向显示,忽略呈现的Controller的preferredInterfaceOrientationForPresentation方法的结果。呈现ViewControlleroverridefuncprepareForSegue(segue:UIStoryboardSegue,sender:Any

ios - MVC : should i add and implement touch gestures in the View Controller or my custom subclass of UIView

我有这个UIView的自定义子类,称为productCardView,它非常简单,有一些UIImageView和UILabels因为它是subview。我添加了subview并将它们设置为-(void)drawRect:(CGRect)rect方法,一切都很好。在我的ViewController中,我从远程服务器获取了一些数据,因此填充了应该可见的productCardView。目的是当用户点击这些卡片中的每一张时,程序将转到目标url(每张卡片的NSURL属性)。问题是根据MVC的基础知识,我应该在View中添加一个UITapGestureRecognizer,在我的productC

ios - 为什么更改 UILabel 文本会触发 viewDidLayoutSubviews 事件?

关闭。这个问题需要detailsorclarity.它目前不接受答案。想改进这个问题吗?通过editingthispost添加细节并澄清问题.关闭8年前。Improvethisquestion我的ViewController中触发了很多viewDidLayoutSubviews事件。最终我缩小到触发事件的单行代码:self.debugLabel.text=[NSStringstringWithFormat:@"%@-%@",key,[@(tag)stringValue]];它是添加到ViewController的self.view的subview中的UILabel。为什么更改UILab

ios - 在ios中获取正确的状态栏颜色

好的,我在给状态栏上色时遇到了一些问题。我有一个非常简单的应用程序,可以在两个View之间移动。我尝试使用此代码为导航Controller的状态栏着色[[UINavigationBarappearance]setBarTintColor:UIColorFromRGB(0x067AB5)];但直到我删除“导航Controller”的状态栏并将状态栏拖到Storyboard中,它才起作用。然后我希望状态栏与颜色相匹配,所以我删除了导航Controller并且它起作用了!我认为导航Controller状态栏不允许状态栏正确着色。但是,如果没有导航Controller,我无法添加“推送”转场。

ios - 应用程序在 UIViewController : com. apple.main-thread 中的用户设备上崩溃

我使用fabric.io来跟踪用户设备上的崩溃。我收到许多带有以下堆栈跟踪的崩溃报告:0libobjc.A.dylib0x33e9ef46objc_msgSend+51UIKit0x29698225+[UIViewController_viewControllerForFullScreenPresentationFromView:]+1962UIKit0x29697cfb-[UIWindow_scrollToTopViewsUnderScreenPointIfNecessary:resultHandler:]+4423UIKit0x29697b1f-[_UIScrollsToTopIn

ios - 如何创建更干净的 UIViewController?

这个问题在这里已经有了答案:ChangetemplatesinXcode(10个答案)关闭7年前。总是,当我创建ViewController时,我有这个:#import"SomeVCC.h"@interfaceSomeVC()@end@implementationSomeVC-(void)viewDidLoad{[superviewDidLoad];//Doanyadditionalsetupafterloadingtheview.}-(void)didReceiveMemoryWarning{[superdidReceiveMemoryWarning];//Disposeofanyr

ios - 如何将另一个 UIViewController 添加到现有的 UINavigationController

我有一个带有两个ViewController的应用程序。第一个嵌入在导航Controller中并有一个导航栏,在第一个ViewController中的某个方法结束后,我以编程方式呈现第二个ViewController。这工作正常,但这样第二个ViewController不是导航Controller堆栈的一部分,并且与第一个ViewController没有任何关系。像这样,我无法利用导航Controller。关于如何解决这个问题的任何想法?在用户从照片库中选取图像后,我向第二个ViewController显示此代码:-(void)imagePickerController:(UIImag