天天看点

scrollview向下偏移64解决方法

1.在所有的 viewController 里都加上

这样所有设备下都是固定 64的位置开始。

- (void)viewDidLoad {

    [super viewDidLoad];

    // Do any additional setup after loading the view.

    // 设置CGRectZero从导航栏下开始计算

    if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {

        self.edgesForExtendedLayout = UIRectEdgeNone;

    }

2.nav的第一个子视图是scrollview的时候   系统才自动给scrollview加上64的inset

这偏移与第三方的下拉刷新冲突

解决冲突 禁止系统偏移  vc.automaticallyadjustsScrollviewInsets =NO

nav.translucent   把原点下移64 和 ios6一样  (一般不用这个)