iOS 7.1问题 - 触摸并拖动该选项卡按钮时,Tabbar图标图像会自动调整大小 [英] iOS 7.1 issue - Tabbar icon image is automatically resize when touch and drag on that tab button
问题描述
我有这段代码
[tabBarItem1 setFinishedSelectedImage:[UIImage imageNamed:@tab_pressed_home_icon] withFinishedUnselectedImage:[UIImage imageNamed: @ tab_home_icon]];
tabBarItem1.imageInsets = UIEdgeInsetsMake(8,0,-2,0);
在标签栏上设置一个图标。
到目前为止,到目前为止一切都有罚款,我更新了Xcode 5.1
并在ios7.1模拟器上运行应用程序。
这里是应用
现在,当我点击标签栏时,图标图像尺寸减小了当我释放手指图像时恢复正常。
但是,如果我点击图标并拖动它,图像看起来像这样(缩小)。
像这样
这怎么可能发生?
无论如何要解决这个问题?
谢谢。
通过像其他人提到的那样设置tabBarItem的imageInsets来解决此问题。您可以在代码中执行此操作,也可以在Interface Builder中执行此操作,这无关紧要。
重要的一点是让顶部插入BE EQUAL到底部插入。
I have this code
[tabBarItem1 setFinishedSelectedImage:[UIImage imageNamed:@"tab_pressed_home_icon"] withFinishedUnselectedImage:[UIImage imageNamed:@"tab_home_icon"]];
tabBarItem1.imageInsets = UIEdgeInsetsMake(8, 0, -2, 0);
which set an icon on the tab bar.
everything work fines so far until last night that i update Xcode 5.1
and run the app on ios7.1 simulator.
here is the app
now when i tap the tab bar the icon image size is decrease an when i release the finger image is back to normal. But if i tap the icon and drag it the image is look like this (scale down).
like this
how can this happen? is there anyway to solve this?
Thanks.
This problem was resolved by setting the imageInsets of the tabBarItem as others have mentioned. You can do this in code or you can do it in Interface Builder, it doesn't matter.
The important point is to have the top inset BE EQUAL to the bottom inset.
这篇关于iOS 7.1问题 - 触摸并拖动该选项卡按钮时,Tabbar图标图像会自动调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!