0

我在 NavigationController 中嵌入的 UIViewController 很少,在更改屏幕标题、按钮标题、隐藏/显示导航栏(顶栏)或工具栏(底栏)时,一切都很酷,但是 - 我不能强制工具栏按钮有这个动画阴影按下时,就像导航栏按钮一样。更重要的是,工具栏按钮和工具栏一样黑——按钮的颜色不应该比工具栏略浅吗?我希望它很清楚,因为我找不到它,甚至找不到合理的标题

4

2 回答 2

0

如果您想要一个黑条(导航或工具栏),请将其设置barStyleUIBarStyleBlack除黑色之外或代替将其着色为黑色。这让它知道按钮的颜色应该与条的颜色不同。

于 2012-08-01T12:08:30.247 回答
0

我无法理解您的整个问题,但对于工具栏问题,您可以为这些按钮赋予不同的颜色,也可以产生改变被点击按钮颜色的效果

UIBarButtonItem *toolBtn      =       [[UIBarButtonItem alloc] initWithTitle:@"Share and Upload"
                                                                              style:UIBarButtonItemStyleBordered
                                                                             target:self
                                                                             action:@selector(your_Target)]; 

toolBtn.tintColor               =           [UIColor redColor];

现在假设 toolBtn 是你在工具栏中的第一个按钮,点击它你想改变它的颜色,然后在你的目标函数中

-(void)your_Target{

   UIBarButtonItem *button1        =           [[your_Toolbar items] objectAtIndex:0];
    button1.tintColor               =           [UIColor brownColor];

// or you can simply loop all toolbar buttons and change the color of only clicked one and for rest keep it default
}

希望这会帮助你..对不起我的英语不好:)

于 2012-08-01T12:05:30.047 回答