IOS5 SDK中UIToolbar上的自定义背景图片 [英] Custom background image on UIToolbar in IOS5 SDK
本文介绍了IOS5 SDK中UIToolbar上的自定义背景图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
昨天下载了 IOS5 SDK,我用来将 UIToolbar 的背景设置为自定义图像的这段代码停止工作.如果我将目标设置为 IOS4.3 及以下,它仍然有效.
Downloaded IOS5 SDK yesterday, and this code which I use to set my UIToolbar's background to a custom image stopped working. If I set the target to IOS4.3 and below it still works.
[self.bizToolbar insertSubview:[[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"navbar-iphone.png"]] autorelease] atIndex:0];
有人在 IOS 5 上遇到过这种情况吗?
Anybody encountered this yet on IOS 5?
推荐答案
可以使用:[[UIToolBar外观] setBackgroundImage:toolBarIMGforBarMetrics:UIBarMetricsDefault];
(iOS 5 新增)
You can use: [[UIToolBar appearance] setBackgroundImage:toolBarIMG
forBarMetrics:UIBarMetricsDefault];
(new in iOS 5)
这篇关于IOS5 SDK中UIToolbar上的自定义背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文