I have a class named Topic. And inside that topic I can create (and delete) Messages. I need to show the messages in a view that can be scrolled/swiped either right or left (Right to show the older messages, and left to go back to the newer messages). Imagine an image collection that can be scrolled sideways in a ScrollView, that how this should look like. Since the messages is being add by the user, I can't use UIImage. I am thinking of the approach that I need to add use UIView instead of a ScrollView, now my problem is how can I make my UIView function as a ScrollView in terms of displaying data?

please help. Thanks.

有帮助吗?

解决方案

You should have to use gesture recognition. Check that user is swiping left or swiping right. after Identifying that you can change UIView with animation. I hope you can get me. This can be useful to you.

其他提示

You should be able to achieve what you want by enabling paging on the scroll view, by setting the following property to YES as shown:

scrollView.pagingEnabled = YES;

This will make the scroll view scroll one page at a time.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top