Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
350 views
in Technique[技术] by (71.8m points)

ios - UITabBarItem setFinishedSelectedImage: deprecated in iOS7

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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]];

these two are alternative to

setFinishedSelectedImage:  withFinishedUnselectedImage:

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...