处理scrollview和tableview偏移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:

self.nabigationcontroller.navigationbar.translucent = yes;

2种方法比较推荐第1种。

原链接:http://www.cocoachina.com/bbs/read.php?tid-246393.html

你可能感兴趣的:(ios)