iOS 11 中scrollview布局往下偏移问题automaticallyAdjustsScrollViewInsets、contentInsetAdjustmentBehavior(iOS 11
2018-01-09 18:20
393 查看
// // ViewController.m // #import "ViewController.h" @interface ViewController () @property (nonatomic,strong)UIScrollView * scrollView; @end @implementation ViewController - (UIScrollView *)scrollView { if (!_scrollView) { _scrollView = [[UIScrollView alloc] init]; _scrollView.frame = CGRectMake(0, 0, 300, 300); } return _scrollView; } - (void)viewDidLoad { self.scrollView.backgroundColor = [UIColor grayColor]; [self.view addSubview:self.scrollView]; //‼️=============判断系统版本 if (@available(iOS 11.0, *)) { self.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; NSLog(@"11.0f"); } else { self.automaticallyAdjustsScrollViewInsets = NO; NSLog(@"10f"); } } @end
相关文章推荐
- iOS 11 automaticallyAdjustsScrollViewInsets属性问题
- [iOS11] contentInsetAdjustmentBehavior 问题, push back时, 界面会上下移动.
- 关于在新建的package中用SetContentView()函数时无法找到已创建的R.layout的布局文件的的问题的解决办法
- 【iOS 1 行代码系列】之 一行代码搞定automaticallyAdjustsScrollViewInsets
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets、、
- iOS中的translucent和automaticallyAdjustsScrollViewInsets用法 - o.0...w - 博客园
- IOS开发中关于automaticallyAdjustsScrollViewInsets属性
- 问题:iOS8设置tableview的setSeparatorInset:UIEdgeInsetsZero不起作用
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets
- contentInsetAdjustmentBehavior各个值之间的区别
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets、、
- IOS项目之UICollectionView中Item布局偏移问题
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets
- iOS中automaticallyAdjustsScrollViewInsets属性
- automaticallyAdjustsScrollViewInsets (iOS)
- ScrollView向下偏移64以及automaticallyAdjustsScrollViewInsets的使用
- 小胖说事11-------automaticallyAdjustsScrollViewInsets(个人认为iOS7中略坑爹的属性)
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets