UIview不会加载viewdidappear [英] UIview doesn't load with viewdidappear
问题描述
我有一个带视图的tableview项目,在此视图中执行的所有操作均由"viewdidappear"方法控制.
I have a tableview project which has a view, everything that I do in this view is controlled by "viewdidappear" method.
我添加了一个新的UIview,其中包含"lines.h"和"lines.m"文件.
I added a new UIview which has "lines.h" and "lines.m" files.
我使用此视图来绘制一些线条并创造上帝.
I use this view to draw some lines and works god.
此额外视图位于滚动视图中,因为要长时间显示在iPhone屏幕上.
This extra view is located in to a scroll view because is to long to display in to iPhones screen.
问题在于viewdidappear不会重新加载uiview数据,而只能与viewdidload一起使用.
The problem is that viewdidappear doesn't reload the uiview data, it only works with viewdidload.
我必须关闭应用程序并重新打开它才能重新加载数据.
I have to close the application and reopen it to get my data reload.
推荐答案
首先,尝试在 viewDidAppear
方法的末尾添加以下行:
First, try adding this line at the end of viewDidAppear
method:
[self.view setNeedsDisplay];
或者:
[_linesView setNeedsDisplay];
第二,提供更多信息.将代码发布到 viewDidLoad
和 viewDidAppear
中.
Second, Provide some more information. Post the code in viewDidLoad
and viewDidAppear
.
这篇关于UIview不会加载viewdidappear的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!