search

Home  >  Q&A  >  body text

Objective-c - Two tableviews. The right one will be blocked without adding top64, but the left one will not. Question: Why?

I want to make one with these two columns , I use two tableviews, so here comes the problem. When I used Swift, I used SB drag and drop. I encountered this situation. At that time, I also added the above 64 padding to the tableview on the right. This time I used Written in object-c code , I still encountered this problem. If the right tabvilew does not add a height of 64, it will be blocked by the navigation. So why is the left side not blocked? I am surprised

The picture below does not add 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);
}];
滿天的星座滿天的星座2841 days ago617

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-05-02 09:25:45

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

    reply
    0
  • Cancelreply