[英]swiping between images within the same view controller
I'm new to swift but have android experience. 我是新手,但是有Android经验。 Is there a iOS control similar to the android viewpager?
是否有一个类似于android viewpager的iOS控件? I'm creating an app that has a view controller that contains a large image view and several text fields.
我正在创建一个包含视图控制器的应用程序,其中包含大型图像视图和几个文本字段。 The image view covers half the screen or more and the text fields take up the rest of the screen.
图像视图覆盖屏幕的一半或更多,文本字段占据屏幕的其余部分。 I need to swipe between images while the text stays in place.
我需要在文字保持原位的同时在图片之间滑动。 What's the best way to implement this?
实现此目的的最佳方法是什么? I thought of adding swipe gesture recognizer and changing the image on swipe but is that the best way?
我想添加滑动手势识别器并更改滑动图像,但这是最好的方法吗?
You can use UIPageControl. 您可以使用UIPageControl。 It has capability to swipe between pages(ie page with image and text)
它具有在页面之间滑动的功能(即带有图像和文本的页面)
You can use a Pageview controller, if you're using a storyboard. 如果您使用的是故事板,则可以使用Pageview控制器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.