IOS5 SDK中UIToolbar上的自定义背景图像 [英] Custom background image on UIToolbar in IOS5 SDK

查看:141
本文介绍了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:toolBarIMG
forBarMetrics:UIBarMetricsDefault];
(iOS新增功能5)

You can use: [[UIToolBar appearance] setBackgroundImage:toolBarIMG forBarMetrics:UIBarMetricsDefault]; (new in iOS 5)

这篇关于IOS5 SDK中UIToolbar上的自定义背景图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆