Why am I getting a “Auto Layout still required after executing -layoutSubviews” error every time my app launches now?

前端 未结 9 917
盖世英雄少女心
盖世英雄少女心 2020-12-11 01:11

Since I added the following code, every time my app opens this UITableViewController it crashes:

 self.noArticlesView = [[UIView alloc] init];
          


        
9条回答
  •  不知归路
    2020-12-11 01:27

    I was subclassing UIScrollView and received the same error message on iOS 7 (but not 8).

    I was overriding layoutSubviews in a manner similar to the following:

    - (void)layoutSubviews {
        [super layoutSubviews];
        // code to scroll the view
    }
    

    I resolved the issue by moving the call to super's layoutSubviews to be the last thing in the method:

    - (void)layoutSubviews {
        // code to scroll the view
        [super layoutSubviews];
    }
    

提交回复
热议问题