简体   繁体   English

ios 中的 Tabbar 位于屏幕顶部

[英]Tabbar in ios at the top of screen

I want to make tabbar at the top of the screen in iOS and want to place 3-4 tabs.我想在 iOS 的屏幕顶部制作标签栏,并想放置 3-4 个标签。 Android is giving functionality by default using Tab bar layout.默认情况下,Android 使用 Tab 栏布局提供功能。 For more understanding https://www.truiton.com/2015/06/android-tabs-example-fragments-viewpager/如需更多了解https://www.truiton.com/2015/06/android-tabs-example-fragments-viewpager/

Thank you for your help.感谢您的帮助。

You can achieve it by using UICollectionView inside your ViewController.您可以通过在 ViewController 中使用UICollectionView来实现它。 Create a custom tab bar on your ViewController and set actions for each bar to navigate the pages on your UICollectionView.在您的 ViewController 上创建一个自定义选项卡栏,并为每个栏设置操作以导航 UICollectionView 上的页面。

You can manipulate your Custom UICollectionViewCell inside cellForItemAt to differentiate each page.你可以操纵你的自定义UICollectionViewCellcellForItemAt来区分每个页面。

For UICollectionView tutorial you can check out this page: https://www.raywenderlich.com/9334-uicollectionview-tutorial-getting-started对于 UICollectionView 教程,您可以查看此页面: https ://www.raywenderlich.com/9334-uicollectionview-tutorial-getting-started

I have created a view pager with a bottom tab bar, like instagram has, on one of my apps using this UICollectionView.我已经创建了一个带有底部标签栏的视图寻呼机,就像 instagram 一样,在我使用这个 UICollectionView 的应用程序之一上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM