How to reload data in UIView
I am working on a project in which
As you can see that there is a horizontal view in which images are shown. I have provide facility of scroll. Therefore I have put UIView
on UIScrollView
than after UIButton
on UIView
. Images on UIButton
come from plist. Problem is that when I delet开发者_开发知识库e the selected image from the plist I am unable to reload data so that deleted image is removed from horizontal view. Can anyone help me in reload data?
The most straight forward solution for reloading the view is to remove all the subviews from the scroll view and then only add the ones that have a corresponding entry in the plist.
You could make a smarter reload that only removes the subviews that have been removed from the plist and then moves the other views, so that there's no gap left after those views. Shouldn't be too hard.
精彩评论