首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏浮躁的喧嚣

    熟悉OC--5:用枚举表示状态、选项、状态码

    LoginStateFail, }; 在定义选项的时候,若这些选项可以彼此组合,各个选项之间可以通过按“按位或操作符”来组合,那么枚举值中可定义为2的幂 typedef NS_ENUM(NSInteger, UIInterfaceOrientation UIInterfaceOrientationLandscapeLeft = 1 << 2, UIInterfaceOrientationLandscapeRight = 1 << 3, } - (UIInterfaceOrientation

    29410编辑于 2023-11-22
  • 来自专栏iOS开发攻城狮的集散地

    iOS屏幕旋转

    UIInterfaceOrientation方向枚举: UIInterfaceOrientationPortrait //home健在下 UIInterfaceOrientationPortraitUpsideDown NSTimeInterval)duration { } //视图旋转动画前一半发生之前自动调用 -(void)willAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation fromInterfaceOrientation { } //视图旋转动画前一半发生之后自动调用 -(void)didAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation 然后在这个类里面写上下面的代码,在使用的时候就用自定义的这个navCtr, 就是说需要在根视图里面控制 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation NS_AVAILABLE_IOS(6_0); ----

    2.1K60发布于 2018-05-22
  • 来自专栏ppppy_oschina

    iOS屏幕旋转处理

    要翻转的时候,首先响应的方法: (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 紧接着 -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:( 再来是 -(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration weakSelf = self; [UIView animateWithDuration:0.5 animations:^{ if (weakSelf.isFullScreenPlay) { //设置状态栏为竖屏 UIInterfaceOrientation keyWindow addSubview:weakSelf.playerView]; weakSelf.isFullScreenPlay = YES; //设置状态栏为横屏 UIInterfaceOrientation

    1.2K40编辑于 2022-11-15
  • 来自专栏梧雨北辰的开发录

    iOS屏幕旋转及其基本适配方法

    UIInterfaceOrientation程序界面的当前旋转方向(可以设置),其源码的定义如下: // Note that UIInterfaceOrientationLandscapeLeft 而UIInterfaceOrientation和UIInterfaceOrientationMask的区别是什么呢? 其实观察源码,我们就会发现这是一种为了支持多种UIInterfaceOrientation而定义的类型。 //方法3 - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation NS_AVAILABLE_IOS(6_0) __ 方法3作用是设置进入界面默认支持的方向,使用了返回值类型UIInterfaceOrientation,默认进入界面的方向是个确定的方向,所以使用UIInterfaceOrientation更适合。

    10.6K60发布于 2018-04-24
  • 来自专栏落影的专栏

    iOS横竖屏切换

    UIDeviceOrientationFaceUp, // 屏幕朝上 UIDeviceOrientationFaceDown // 屏幕朝下 } UIInterfaceOrientation UIInterfaceOrientation,表示页面内容朝向,注意UIInterfaceOrientation和UIDeviceOrientation的关系,其中UIInterfaceOrientationLandscapeLeft 不用特别细究两者之间关系,我们只需要根据需要设置好UIInterfaceOrientation即可,通过 [UIApplication shareApplication] statusBarOrientation typedef NS_ENUM(NSInteger, UIInterfaceOrientation) { UIInterfaceOrientationUnknown = UIDeviceOrientationUnknown self presentViewController:landVC animated:YES completion:nil]; } // LandscapeViewController内部代码 - (UIInterfaceOrientation

    3.5K20编辑于 2022-09-28
  • 来自专栏ShaoYL

    iOS---iPad开发及iPad特有的特技

    在iOS7及以前得到屏幕旋转方向的方法 /** // UIInterfaceOrientation ,屏幕方向 UIInterfaceOrientationUnknown = UIDeviceOrientationUnknown UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft */ - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation duration { // 即将旋转执行动画 NSLog(@"%s", __func__); } - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation

    3.2K70发布于 2018-05-11
  • 来自专栏c#开发者

    IOS5开发-控件位置适应屏幕旋转代码

    - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toOrientation                                   with the accelerometer; this is an overriden method.// - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation

    1.7K110发布于 2018-04-12
  • 来自专栏一“技”之长

    iOS6中横屏的处理方法 原

    现在我们来看决定屏幕方向的几个函数: 在IOS6之前,我们只需通过一个函数 - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation supportedInterfaceOrientations and/or shouldAutorotate.. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation

    1.3K60发布于 2018-08-15
  • 来自专栏一“技”之长

    iOS翻页视图控制器UIPageViewController的应用

    pageViewController:(UIPageViewController *)pageViewController spineLocationForInterfaceOrientation:(UIInterfaceOrientation pageViewController:(UIPageViewController *)pageViewController spineLocationForInterfaceOrientation:(UIInterfaceOrientation pageViewController:(UIPageViewController *)pageViewController spineLocationForInterfaceOrientation:(UIInterfaceOrientation

    2.9K10发布于 2018-08-15
  • 来自专栏全栈程序员必看

    iOS:分割控制器UISplitViewcontroller

    UISplitViewController *) sender shouldHideViewController:(UIViewController *)master inOrientation:(UIInterfaceOrientation UISplitViewController *)sender shouldHideViewController:(UIViewController *)master inOrientation:(UIInterfaceOrientation

    3.4K30编辑于 2022-07-05
  • 来自专栏腾讯Bugly的专栏

    【团队分享】手机QQ:升级iOS8.3后,发图就崩,为哪般?

    查阅了开发文档了解supportedInterfaceOrientations方法的使用,发现其返回值实际是UIInterfaceOrientationMask 类型,而项目中却返回了UIInterfaceOrientation 类型,二者虽然长得很相似,但用处完全不一样: UIInterfaceOrientationMask类型用来表示UIViewController能支持的方向 UIInterfaceOrientation类型用来表示

    1.4K40发布于 2018-03-22
  • 来自专栏全栈程序员必看

    iphone相册打开是横屏_苹果手机相册变成横屏怎么办

    -(BOOL) shouldAutorotate{ return Yes; } -(NSUInteger) supportedInterfaceOrientations{ } -(UIInterfaceOrientation

    3K20编辑于 2022-11-09
  • 来自专栏iOS开发~

    iOS_适配 iOS16 转屏

    UIDeviceOrientationFaceDown: return @"FaceDown"; } } NSString *MOInterfaceOrientationDescription(UIInterfaceOrientation

    1.7K10编辑于 2023-10-18
  • 来自专栏LinXunFeng的专栏

    iOS 面向协议封装全屏旋转功能

    相关属性说明 Name Type Desc Default animateDuration Double 进入/退出 全屏时的旋转动画时间 0.25 enterFullScreenOrientation UIInterfaceOrientation

    1.4K60发布于 2018-10-10
  • 来自专栏一“技”之长

    iOS好用的第三方侧边栏控件——MMDrawerController

    completion __attribute((objc_requires_super)); //设备旋转方向时调用的方法 -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation NSTimeInterval)duration __attribute((objc_requires_super)); -(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation

    3.6K20发布于 2018-08-15
  • 来自专栏码客

    iOS 使用WKWebView

    myWebView.scrollView.bounces = false; } override func willAnimateRotation(to toInterfaceOrientation: UIInterfaceOrientation

    2K10发布于 2019-10-21
  • 来自专栏云原生布道专栏

    【IOS】IOS开发问题解决方法索引(一)

    StatusBar框将要变化时执行 10、- (void)application:(UIApplication*)application willChangeStatusBarOrientation: (UIInterfaceOrientation url 说明:当通过url执行 12、- (void)application:(UIApplication*)application didChangeStatusBarOrientation:(UIInterfaceOrientation

    1.4K40编辑于 2022-03-08
  • 来自专栏iOS逆向与安全

    iOS自定义相机:带拍摄区域边框、半透明遮罩层、点击屏幕对焦、自动裁剪(含demo源码)

    UIInterfaceOrientationMask)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } -(UIInterfaceOrientation

    4K30发布于 2021-07-05
  • 来自专栏iOS逆向与安全

    iOS 小技能:Method Swizzling (交换方法的IMP)

    UIInterfaceOrientationMask)sd_supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } -(UIInterfaceOrientation UIInterfaceOrientationMask)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } -(UIInterfaceOrientation

    2.2K10编辑于 2022-08-22
  • 来自专栏滕先生的博客

    UINavigationController 导航控制器概念属性方法

    navigationControllerSupportedInterfaceOrientations:(UINavigationController *)navigationController; (4)设置导航控制器的首选设备方向 - (UIInterfaceOrientation

    3.2K60发布于 2018-05-18
领券