uiinterfaceorientation相关内容
您好,我有一个应用程序,我有两个 *.png 用于默认启动画面: 默认横向.pngDefault-Portrait.png 我想要的是在我的应用程序加载完毕并准备好运行时为这个默认启动屏幕设置动画. 为了实现这一点,我通常会呈现一个带有默认横向或默认纵向(取决于设备方向)的 UIImageView,将其在屏幕上保留一段时间,然后将其动画化. 我的问题是,如果我在 中调用
..
我正在学习/试验自动布局和 UITableViewCell.几天前我问了另一个问题,我回答了我自己的问题,我仍然使用相同的约束/代码.有关完整代码,请参见此处:AutoLayout 多行 UILabel 截断一些文本. 为了在 heightForRowAtIndexPath 内缩短它,我使用自定义 UITableViewCell 的实例来计算行需要的高度.这在纵向上非常有效,但是当我切换到横
..
我的视图由导航控制器控制,因此我将支持的方向设置到导航控制器中以显式纵向 &PortraitUpSideDown 并且这有效,但是如果在调用视图时之前的视图处于横向状态,它将以横向形式呈现并保持横向状态,直到设备旋转.我该如何防止这种情况发生? 这是我的代码: 类 EditProfileViewController: UIViewController, UINavigationContro
..
我正在使用 Xcode 菜单“编辑器...嵌入...导航控制器"在界面构建器中使用情节提要. 似乎在 iOS 6 中,您必须将 UINavigationController 子类化以允许所有方向,使用 - (NSUInteger)supportedInterfaceOrientations {返回(UIInterfaceOrientationMaskAll);} 但是由于代码中没有对 U
..
我有一个导航控制器,它有几个视图控制器.我需要支持所有视图控制器的所有方向,除了一个只支持横向的特殊视图控制器.这个特殊的视图控制器出现在导航堆栈的中间.我做了很多研究,但找不到任何好的解决方案.以下是我阅读并尝试过的链接. http://www.iphonedevsdk.com/forum/iphone-sdk-development/3219-force-landscape-mode-o
..
我发现很多问题迫使 UIViewController 默认为横向:如何在 iOS 中强制 UIViewController 为纵向6试试这个: - (BOOL)shouldAutorotate{返回是;}-(NSUInteger)支持的接口方向{返回 UIInterfaceOrientationMaskLandscape;}- (UIInterfaceOrientation)preferredI
..
我正在构建一个仅适用于主要视图(正常和倒置)的纵向应用程序.我已经在项目设置/Plist 中设置了这个设置,一切正常.但是,我有一些模态视图可以执行显示图像/视频之类的操作,我希望它们能够旋转到所有方向. 我尝试为 UINavigationController 添加一个类别,但没有成功.我还向调用模态的 viewController 添加了以下代码: -(BOOL)shouldAutoma
..
我有一个带有分页的滚动视图.在 viewDidLoad 我检查当前方向是否为横向,然后我将其 contentsize 的高度设置为 440 if (UIDeviceOrientationIsPortrait([[UIDevice currentDevice]orientation])){[滚动 setContentSize:CGSizeMake(self.scroll.frame.size.w
..
我在与 iOS6 完美配合的 UIPopoverController 中使用 UIImagePickerController.在 iOS 7 中,显示用于捕获图像的“预览"图像会旋转,但如果我拍照,它会被正确保存. 这就是我如何得到我的选择器: UIImagePickerController *imagePicker = [[UIImagePickerController alloc] i
..
我还应该做什么? -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) toInterfaceOrientation{返回(toInterfaceOrientation == UIInterfaceOrientationPortrait);}- (NSUInteger)supportedInterfaceOr
..
我正在尝试检测任何设备方向的变化,以便我可以更新视图. 无论方向是纵向还是横向,我都想更新视图,所以我实现了这个方法: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {//为支持的方向返回 YES.return (interfaceOrientation
..
我的应用程序支持每 4 个方向,我在 LandscapeRight 中有一个 UIViewController.我正在使用 UINavigationController 来推送那个 UIViewController,我希望 UIViewController 只在 UIInterfaceOrientationLandscapeRight 中,但是当我旋转时手机,它切换回其他方向. -(BOOL)s
..
我正在尝试从支持横向(在横向模式下)的视图控制器转变为明确不(也不应该)支持横向的视图控制器.我这样做如下: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {返回(toInterfaceOrientation == UIInterfaceOrientati
..
我有一个 UIView,它占据了 iphone 上的整个窗口.当它旋转到横向时,边缘会出现小黑条,直到它卡入到位,正如我所期望的那样. 我想让那个 uiview 比屏幕大,这样旋转它就不会显示那些黑条,而是显示通常在屏幕外的视图部分.我试过增加视图的框架和边界,但这似乎不起作用. 有人成功过吗? 解决方案 你需要做两件事来实现这一点. 首先,窗口的根视图控制器将始终将其视
..
我相信这是一个常见问题,许多答案不再有效,许多只是部分答案,如果您使用的是 iOS7 并且您的 iPad 应用程序仅为横向,但您想使用 UIImagePickerController使用源 UIImagePickerControllerSourceTypePhotoLibrary 或 UIImagePickerControllerSourceTypeCamera. 如何正确设置,使其 100
..
所以我跟着这个线程:RootViewController Switch Transition Animation 将 window.rootViewController 从A 到 B 到 C.代码如下所示: [UIView transitionWithView:self.window持续时间:0.5选项: UIViewAnimationOptionTransitionFlipFromLeft动画
..
在 iOS 5 中,我们可以像这样以编程方式更改设备方向: [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight]; 但是在 iOS 6 中 setOrientation 已被弃用,我如何在 iOS 6 中以编程方式更改设备方向? 解决方案 这是我的“五美分",在 iOS7 和 ARC
..
我在 iOS 7 和 iOS 8 中运行了以下代码: UIInterfaceOrientationorientation = [[UIApplication sharedApplication] statusBarOrientation];BOOL Landscape = (orientation == UIInterfaceOrientationLandscapeLeft ||orientat
..
func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) ->UIInterfaceOrientationMask{返回 UIInterfaceOrientationMask.Portrait.rawValue.hashValue |UIInterf
..
我在 Xcode 5 中创建了自定义按钮.在纵向视图中黄色按钮必须显示,在横向模式中蓝色按钮必须显示.我的代码如下: -(BOOL)shouldAutorotate {UIInterfaceOrientation 方向 = [[UIApplication sharedApplication] statusBarOrientation];如果(方向 == UIInterfaceOrientatio
..