在我的 viewDidAppear 中,我正在更改其中一个 ImageView 的框架。在我 [self viewDidAppear] 之前, View 和所有其他方法都不会显示它。 我感觉不对,有没有reloadData消息?
谢谢。
最佳答案
没错,自己调用[self viewDidappear]
是不对的。
如果您需要在 View 上更改 View 的框架,请自己创建一个您可以随时调用的方法,或者使用 viewDidLayoutSubviews
;
When the bounds change for a view controller’s view, the view adjusts the positions of its subviews and then the system calls this method. However, this method being called does not indicate that the individual layouts of the view’s subviews have been adjusted. Each subview is responsible for adjusting its own layout.
另外,检查你的方法是否有正确的实现:
-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
//Your code
}
关于ios - 重新加载 viewDidAppear 以便它将用作 ViewDidLoad,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19362240/