草庐IT

UIInterfaceOrientation

全部标签

iphone - UIWebView 横向旋转不填充 View

我的UIWebView有问题。当View加载时,它会以任一方向加载,完美地填充整个页面等。但是如果我以纵向加载它然后旋转设备,webview不会一直填充到右侧,我无法弄清楚为什么。这是我的View加载方法-(void)viewDidLoad{[superviewDidLoad];//Doanyadditionalsetupafterloadingtheviewfromitsnibif([[UIApplicationsharedApplication]statusBarOrientation]==UIInterfaceOrientationPortrait){self.measureme

ios - 当我的整个应用程序锁定在纵向模式时,以横向模式全屏播放视频

我想全屏横向播放视频。我的应用程序锁定在纵向模式。如何实现这一点。请帮我。提前致谢 最佳答案 swift3中最简单的解决方案将此添加到您的应用委托(delegate):funcapplication(_application:UIApplication,supportedInterfaceOrientationsForwindow:UIWindow?)->UIInterfaceOrientationMask{ifwindow==self.window{return.portrait}else{return.allButUpsideD

ios - 如何通过 UIView 引用获取设备方向?

我需要从ViewController获取设备方向。我不能基于:[[UIDevicecurrentDevice]beginGeneratingDeviceOrientationNotifications];UIDeviceOrientationorientation=[[UIDevicecurrentDevice]orientation];因为它有时会返回方向未知(例如当设备放在table上时)。我只需要知道我当前的UIView以什么方向显示(是左横向还是右横向)。当方向改变时,我不需要更新这个值,我只是想知道它,当我要求它时。只是一些引用view.orientation;)。有什么可以

ios - UISplitViewController 和方向 - iOS < 5.0

我正在使用splitviewcontroller作为我的应用程序的RootView。我需要将登录和注册View显示为splitviewcontroller顶部的模态视图。当我尝试从splitViewController的RootView的viewdidAppear方法显示登录/注册View时,它没有显示。我尝试使用以下代码从Appdelegate的didFinishLaunching方法呈现登录/注册View[self.window.rootViewControllerpresentModalViewController:self.navControlleranimated:NO];而

ios - 等待 10 秒后未能返回。主运行循环模式 : kCFRunLoopDefaultMode void SendDelegateMessage(NSInvocation*): delegate

我正在使用CorePlotheader开发一个iOS应用程序。我有不同的横向和纵向用户界面。在方向更改时,我收到此在等待10秒后返回失败。主运行循环模式:kCFRunLoopDefaultModevoidSendDelegateMessage(NSInvocation*):delegate当我尝试修改UIView的框架时。有人可以建议我该怎么做吗。 最佳答案 调试此问题的一些建议,首先尝试弄清楚绘图的哪一部分花费了这么长时间。尝试使用仪器中的TimeProfiler仪器,Hold选项以选择程序陷入困境的图形部分,并检查调用树。尝试有

ios - 在 iOS 9 中强制 View Controller 方向

我正在开发一款可以拍摄人像或风景照片的应用程序。由于项目需要,我不能让设备方向自动旋转,但需要支持旋转。当使用以下定位方法时:overridefuncshouldAutorotate()->Bool{returntrue}overridefuncsupportedInterfaceOrientations()->UIInterfaceOrientationMask{ifself.orientation==.Landscape{returnUIInterfaceOrientationMask.LandscapeRight}else{returnUIInterfaceOrientation

ios - 为纵向和横向模式获得相同的屏幕宽度和高度

我已经使用这段代码来获取屏幕宽度和屏幕高度,floatscaleFactor=[[UIScreenmainScreen]scale];CGRectscreen=[[UIScreenmainScreen]bounds];CGFloatwidthInPixel=screen.size.width*scaleFactor;CGFloatheightInPixel=screen.size.height*scaleFactor;NSLog(@"%f",widthInPixel);NSLog(@"%f",heightInPixel);和CGRectscreenBounds=[[UIScreenma

ios - UISegmentedControl 中的两行文本

尽我所能,我无法解决iOS7iPhone应用程序的UISegmentedControl错误。当我创建分段控件时,我使用了这段代码:NSArray*segmentedControlItemArray=[NSArrayarrayWithObjects:@"Nominal:\n27inch",@"Actual:\n700cx23mm",@"Actual:\n700cx20mm",nil];_wheelDiameterSegmentedControl=[[UISegmentedControlalloc]initWithItems:segmentedControlItemArray];_whee

ios - UIPopoverController 出现在错误的位置

所以我花了一些时间寻找这个问题的答案,但到目前为止还没有找到任何东西。我正在尝试通过UIInputAccessoryView上的按钮显示弹出窗口。我想从中显示弹出窗口的UIBarButtonItem具有自定义View,因此我可以使用图像。我这样创建按钮:buttonImage=[UIImageimageNamed:@"tags.png"];aButton=[UIButtonbuttonWithType:UIButtonTypeCustom];[aButtonsetImage:buttonImageforState:UIControlStateNormal];aButton.frame=

ios - iOS 6 中的模态视图 Controller 强制横向方向

我有一个以纵向模式显示的UITabBarController。在其中一个选项卡上,我有一个按钮,它以模态方式显示UIViewController(一个简单的Storyboardsegue执行该操作)。我想让这个模态视图以横向模式显示,但我无法让它自动转动。我在模态视图Controller中有这个-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{return(interfaceOrientation==UIInterfaceOrientationLandsc