UIPageControl - iPhone 开发
我有 5 张图片要以 UIPageControl 方式显示(一次一张),因此每当我滚动(向右或向左)时,就会显示另一张图片。我找不到示例代码! 我搜索了很多,苹果的示例代码很复杂,我需要一个更简单的代码。
I have 5 pics to display (one at a time) in a UIPageControl way, so whenever i scroll (right or left) another pic will show. i can't find a sample code for that!
i searched a lot and apple's sample code is complicated i need a simpler one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上您正在寻找的是带有分页的UIScrollView。 UIPageControl 是主要(不一定)位于滚动视图底部的小点。您必须单独配置它。
要在滚动视图中启用分页,您需要将其 pagingEnabled 属性设置为 YES。
以下UIScrollView分页教程 可能对你有帮助。
Actually what you are looking for is UIScrollView with pagination. UIPageControl is the small dots that is mostly(not necessarily) positioned on the bottom of scroll view. You have to configure it separately.
To enable paging in a scroll view, you need to set its pagingEnabled property to YES.
The following UIScrollView paging tutorial may help you.