如何在swift中制作页面滑动应用程序?

How to make page swipe app in swift?

几天前,我做了Android个应用。现在我应该在 IOS 中制作相同的应用程序。所以,我正在学习swift。要与 Android 制作相同的应用程序,我正在寻找
Android 中的 'ViewPager' 这样的库。我搜索并找到了一些库,但它们是自定义库。我只想使用像 'ViewPager' 这样形成的库。很多人说,你要的是'PagingMenuController'。但是我找不到关于那个的成型库。

要使用标签或滑动更改视图,我应该使用 'PageMenuController' 吗?

如果是真的,谁能告诉我怎么用? link 或 youtube 都无所谓,请告诉我。我是 swift 的新人,所以如果它包含图像或媒体对我来说更合适。

UICollectionView

UICollectionViewLayout

来自 Apple 文档:

The layout object to use. Use this control to select between the UICollectionViewFlowLayout object and a custom layout object that you define.

When the flow layout is selected, you can also configure the scrolling direction for the collection view’s content and whether the flow layout has header and footer views. Enabling header and footer views adds reusable views to your storyboard that you can configure with your header and footer content. You can also create those views programmatically.

When a custom layout is selected, you must specify the UICollectionViewLayout subclass to use.

文档:看看here

希望对您有所帮助

据我了解,您正在尝试制作像 UI

这样的介绍页面

您可以使用UIPageViewController

以下是您可以考虑的链接

  1. https://medium.com/how-to-swift/how-to-create-a-uipageviewcontroller-a948047fb6af
  2. https://www.appcoda.com/uipageviewcontroller-tutorial-intro/

如果您更喜欢第三方支持,可以使用以下链接:

  1. https://github.com/hyperoslo/Pages
  2. https://github.com/tzef/BmoViewPager
  3. https://github.com/emalyak/EMPageViewController
  4. https://github.com/uias/Pageboy
  5. https://github.com/theothertomelliott/TEQuickPageViewController
  6. https://github.com/uias/Tabman
  7. https://github.com/naoto0822/SwipePager

希望对您有所帮助。

你听说过 CocoaPods 吗? 您可以使用一些有用的库来为您的应用制作动画(例如 Hero ) ; for page Swiping there is Pageboy : a simple, highly informative page view controller. .

如果您不知道什么是 cocoa pods 或如何安装它,请观看此视频 (Cocoa Pods Tutorial - How to install and setup Cocoa Pods)