When is the layoutSubviews method called?

后端 未结 3 1752
粉色の甜心
粉色の甜心 2020-12-25 10:22

I am going through a tutorial that mentions the following method:

-(void)layoutSubviews

located in CustomerCell.m

When is this meth

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-25 11:07

    You are correct. Layout subviews is automatically invoked. Check the docs for more information on it.

    The docs don't specifically say WHEN this is called. However, you can pretty much guarantee it is called rather often. You really only want to override this method when you can't have your subviews resize or move themselves using struts and springs. One instance would be reorganizing subviews positions when the device changes orientation.

提交回复
热议问题