UITabBarItem setFinishedSelectedImage:在 iOS7 中已弃用 [英] UITabBarItem setFinishedSelectedImage: deprecated in iOS7

查看:19
本文介绍了UITabBarItem setFinishedSelectedImage:在 iOS7 中已弃用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

setFinishedSelectedImage:withFinishedUnselectedImage: 在 iOS7 中已弃用.Apple 建议使用 image 的 settercode> 和 selectedImageUIImageRenderingModeAlwaysOriginal 代替.我找不到关于如何使用 UIImageRenderingModeAlwaysOriginal 的任何示例.所以问题很简单:如何在 iOS7 中为 UITabBarItem 设置图片?

setFinishedSelectedImage:withFinishedUnselectedImage: is deprecated in iOS7. Apple recommends to use setters of image and selectedImage with UIImageRenderingModeAlwaysOriginal instead. I can't find any example of how to use UIImageRenderingModeAlwaysOriginal. So the question is really simple: how to set images for UITabBarItem in iOS7?

推荐答案

如果您想在 UITabBar 上实现实际图像的显示,请使用以下代码.

If you're are trying to achieve displaying of the actual image at the UITabBar then use the following code.

[yourTabBarItem setImage:[[UIImage imageNamed:@"more.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

如果您想以原始状态显示所选图像,请使用以下内容

and if you want to display image in original condition for the selected then use the following

[yourTabBarItem setSelectedImage:[[UIImage imageNamed:@"more.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

这两个是

setFinishedSelectedImage:  withFinishedUnselectedImage:

这篇关于UITabBarItem setFinishedSelectedImage:在 iOS7 中已弃用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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