![](/img/trans.png)
[英]How can I change a UITabBarItem title to the title from another UITabBarItem?
[英]How can I determine UITabBarItem position?
如何确定UITabBarItem是否具有标题“ Hello”且位置为0?
我宁愿让使用项目的索引indexOfObject
上tabBar
项目数组:
NSUInteger index = [tabBar.items indexOfObject:item];
使用UITabBar的items
属性,例如:
if([[myTabBar items] indexOfObject:myTabBarItem] == 0)
{
UITabBarItem* theItem = [[myTabBar items] objectAtIndex:0];
if([theItem.title isEqualToString:@"Hello"])
{
// it's in position 0 and has title "Hello"
}
}
uitabbaritem继承自uibaritem,后者定义了标签和标题属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.