简体   繁体   中英

Background Image color losing in UIToolbar

I have two images an arrow and a bar image

image1===>An arrow

在此处输入图片说明

The orginal color values of this arrow is shown below

在此处输入图片说明

image2===>The Bar

在此处输入图片说明 The orginal color values of bar are shown below.

在此处输入图片说明

I am loading the barImage in the toolbar with the following code and showing the arrow just above it.

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

Now the bar image is loosing its orginal color as shown below.

在此处输入图片说明

The new color values are

在此处输入图片说明在此处输入图片说明

The bar button lost its orginal color. Can anyone suggest me a work around?

Thanks in Advance.

This should do the trick:

[bottomBar setTranslucent:NO] 

UIToolbar's translucency set to YES by default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM