UITableViewWrapperView and UITableView size differs with autolayout

后端 未结 7 2071
一生所求
一生所求 2020-12-28 16:38

I am building a chat. Everything seem to be quite ok but I bumped into sort of \'buggy\' problem.

i got UIViewController with UITextView bar for entering message and

7条回答
  •  鱼传尺愫
    2020-12-28 16:56

    Objective C version of this answer given by anorskdev

    - (void) viewWillLayoutSubviews {
        [super viewWillLayoutSubviews];
        [tableView setContentInset:UIEdgeInsetsZero];
        [tableView setScrollIndicatorInsets:UIEdgeInsetsZero];
    }
    

    edit: Turning off automaticallyAdjustsScrollViewInsets on the hosting ViewController, as suggested by Steve Roy in this answer, also worked and is the one I went with, as it seems cleaner to disable the behaviour rather than correcting it afterwards.

提交回复
热议问题