[英]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.