ios - UITabBar selectionIndicatorImage 带有 3 个条创建不需要的填充

标签 ios objective-c uitabbar

我的应用程序中有一个带有 3 个条的 UITabBar。我想要做的是实现自定义 selectionIndicatorImage。一切都很好,除了最后一个栏,我在右边有一个奇怪的 1 pt 填充。

示例

UITabBar

代码

[[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 :

https://github.com/robbdimitrov/RDVTabBarController

关于ios - UITabBar selectionIndicatorImage 带有 3 个条创建不需要的填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16871910/

相关文章:

iphone - 实现授权

ios - 为什么 spotify 登录不起作用?

ios - 在我的 CocoaPod 中使用未声明的标识符

iphone - 文本编辑无法识别编码

ios - iOS 7 中的 ViewController 撤消 Segue

iphone - 如何突出显示 iOS 工具栏等图标

ios - UITabbar Tab 更改动画在转换时显示黑色故障

ios - 如何在不同的 UICollectionView 单元格中显示不同的视频?

ios - 如何判断是否未选择数组中的所有按钮

objective-c - 在网络偏好设置 Pane 中设置 "Location"值,而不使用私有(private) API