2

升级 xcode 以包含 iOS7.1 后,我遇到了有线问题。工具栏的背景颜色在模拟器中显得非常明亮,更改 alpha 值对其没有任何影响。红色曾经是浅红色。

在此处输入图像描述

我将颜色设置为viewDidLoad

[self.navigationController setToolbarHidden:NO]; //animated:YES
[self.navigationController.toolbar setBarTintColor:[UIColor colorWithRed:0.8f green:0.0f blue:0.0f alpha:0.5]];
[self.navigationController.toolbar setTranslucent:YES];

有任何想法吗?

4

1 回答 1

0

设置图像仍然有效:

UIImage* toolbarImage = [UIImage imageNamed: @"myimagename"];
[[UIToolbar appearance]
     setBackgroundImage: toolbarImage
     forToolbarPosition: UIToolbarPositionAny
     barMetrics: UIBarMetricsDefault];

此图像在为 png 时可以是半透明的

于 2016-04-20T21:51:08.900 回答