objective-c - 俩个tableview,右侧的不加top64会被挡住,左侧就不会,问:为什么?
滿天的星座
滿天的星座 2017-05-02 09:23:45
0
1
577

我要做一个这两列的 ,我用的是俩个tableview,那么问题来了,我用swift的时候是SB拖拽做的,遇到过这个情况,当时也是给右侧的tableview加上面64的padding,这次用的是object-c代码写的,还是遇到了这个问题,如果右侧的tabvilew不加64的高度就会被导航挡住,那么为什么左侧不被挡住呢,我就奇怪了

下面这个图是不加64的

[leftTable mas_makeConstraints : ^(MASConstraintMaker *make) {

    make.left.equalTo(self.view.mas_left).offset(0);
    make.bottom.equalTo(self.view.mas_bottom).offset(-0);
    make.right.equalTo(rightTable.mas_left);
    make.width.equalTo(@100);
    make.height.equalTo(@(bound.size.height));
}];



[rightTable mas_makeConstraints : ^(MASConstraintMaker *make) {
    make.left.equalTo(leftTable.mas_right).with.offset(100);
    make.height.equalTo(@(bound.size.height));
    make.right.equalTo(self.view.mas_right);
    make.top.equalTo(self.view.mas_top).offset(64); 这个64如果改为0  就是第2张图的效果,为什么呢?左侧为什么就不挡住呢?
    make.bottom.equalTo(self.view.mas_bottom);
}];
滿天的星座
滿天的星座

reply all(1)
Peter_Zhu

In SB, automatic adjustment is only effective for the first View. You can adjust the order of subviews to see if it has changed

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!