开发者

Clear UIView / UIScrollView content upon dismissal of modal view

开发者 https://www.devze.com 2023-04-13 03:08 出处:网络
I currently have a UIView / UIScrollView that is displayed within a modal view. It is开发者_如何学C basically a detail view that provides a view of a page when the user clicks a link. When the view is

I currently have a UIView / UIScrollView that is displayed within a modal view. It is开发者_如何学C basically a detail view that provides a view of a page when the user clicks a link. When the view is dismissed and then brought up again (when the user clicks another button), the previously-loaded content is still visible and the new content loads "on top" of the last content. This makes sense because the instance of the UIView / UIScrollView persists and is only released when the memory is needed.

However, I would like to completely clear the UIView / UIScrollView when the modal view is dismissed so that 1) content is cleared and 2) memory is freed.


rightDetailedView = [[UIScrollView alloc] init]; rightDetailedView.backgroundColor = [UIColor whiteColor];

The above code initializes the view every time this method is called and to my knowledge when we are recreating a view the background will be transparent so we need to add backgroundColor with whiteColr or some color.

Thanks,

Kris :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号