我的应用程序中有一个带有 3 个条的 UITabBar。我想要做的是实现自定义 selectionIndicatorImage。一切都很好,除了最后一个栏,我在右边有一个奇怪的 1 pt 填充。
示例
代码
[[UITabBar appearance] setBackgroundImage:[UIImage imageNamed:@"tabbar-test.png"]];
[[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageNamed:@"tabbar-selected.png"]];
尺寸
tabbar-test.png 320x49 和 640x98
tabbar-selected.png 107x49 和 214x98
最佳答案
以下是一些与您的问题类似的问题:
How do I remove UITabBarItem selectionImage padding?
UITabBar selectionIndicatorImage padding
我遇到了这个问题,但没有找到好的解决方案。最后,我使用了第三部分 Controller :
关于ios - UITabBar selectionIndicatorImage 带有 3 个条创建不需要的填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16871910/