ios - UITabBarItem 只显示没有图像的文本?

标签 ios swift3 uitabbarcontroller uitabbar

我只想显示没有图像的标签栏项目的标题。可能吗?当我尝试设置

let tabItem = UITabBarItem()
tabItem.title = "Tab1"
tabItem.selectedImage = nil
tabItem.image = nil
tabViewController?.tabBarItem = tabItem

我只是得到一个可点击的空白区域,但没有标题或图像。

最佳答案

最简单的方法是从选项卡栏中删除图像并设置自定义垂直偏移量。如图所示。或者点击 TJ3n prived remove the images in the UITabBarItem and aligned vertically the title 的链接.

enter image description here

关于ios - UITabBarItem 只显示没有图像的文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42974166/

相关文章:

ios - 将内部测试人员添加到 TestFlight 不起作用 - 未发送电子邮件

ios - 如何使用 CoreImage 滤镜实现灰度滤镜?

ios - 在多个 View Controller 中处理相同的 NSNotification

swift - sectionIndexTitles(对于 tableView : UITableView) method returns strange results

ios - UICollectionView 未正确重新加载

ios - 使用自动布局获取自定义 UITableViewCell 内 UIButton 的大小

ios - 使用图像选择器将照片保存到 2 个不同的 imageview (swift 3)

iphone - 导航 Controller 注销

ios - PopToRootViewController 在 UITabBarController 中显示不平衡消息

objective-c - TvOS UITabBarController 检测标签栏显示/隐藏