safeAreaInsets.top 值为0?

2019-07-23  本文已影响0人  ProgramTheApe
- (void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
    if (@available(iOS 11.0, *)) {
        DLog(@"%f",self.view.safeAreaInsets.top);
        self.headView.y =  self.view.safeAreaInsets.top;
    } else {
        self.headView.y = 20;
    }
}
2019-07-23 16:33:35.492756+0800 XXX[9522:381219] 44.000000
上一篇下一篇

猜你喜欢

热点阅读