简体   繁体   English

如何在iPhone中创建可配置的标签栏(例如音乐应用)

[英]How to create a configurable Tab bar like music app in iPhone

我想在我的应用程序(如iPhone音乐应用程序)中实现可配置的标签栏,用户可以通过在其中拖放图标来编辑标签栏。

Well, then it's a good thing that UITabBar has this functionality built in. Take a look at the following method: 好的,那么UITabBar内置了此功能是一件好事。请看以下方法:

UITabBar *mybar = [[UITabBar alloc] init];
[mybar beginCustomizingItems:[NSArray arrayWithObjects:tabItem1, tabItem2, nil]];

UITabBarController handles this completely automatically. UITabBarController完全自动处理此问题。 If you add more than 5 tabs to the tab controller then the fifth button changes to 'More' to allow the user to access the configuration interface. 如果向选项卡控制器添加了5个以上的选项卡,则第五个按钮将更改为“更多”,以允许用户访问配置界面。

If you want to customise the behaviour or do something completely different then implement the UITabBarDelegate protocol. 如果要自定义行为或执行完全不同的操作,请实施UITabBarDelegate协议。

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

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