背景图像颜色在UIToolbar中丢失

时间:2014-06-25 19:10:33

标签: ios ipad ios7 uitoolbar

我有两个图像箭头和条形图像

image1 ===>箭头

enter image description here

此箭头的原始颜色值如下所示

enter image description here

image2 ===>栏

enter image description here 条形的原始颜色值如下所示。

enter image description here

我正在使用以下代码加载工具栏中的barImage,并在其上方显示箭头。

 bottomBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0,974,931,54)];
[bottomBar setBackgroundImage:[UIImage imageNamed:@"bottomBar.png"]
           forToolbarPosition:UIBarPositionAny
                   barMetrics:UIBarMetricsDefault];

现在条形图像正在失去其原始颜色,如下所示。

enter image description here

新颜色值为

enter image description here enter image description here

条形按钮失去了原始颜色。有谁能建议我解决这个问题?

先谢谢。

1 个答案:

答案 0 :(得分:0)

这应该可以解决问题:

[bottomBar setTranslucent:NO] 

默认情况下,UIToolbar的半透明度设置为YES。

相关问题