ios - iPhone X - 底栏高度
问题描述
当我在 iPhone 模拟器上测试时,我的应用程序的底部栏出现问题。“使用安全区域布局指南”选项已启用。底部栏的高度看起来不错,但是当我单击一个图标时,该选定图标的背景应该是全白色的,但情况并非如此。我正在使用标签栏控制器。
此外,我认为的文本和标签是像素化的。
我的这个自定义标签栏控制器的代码如下
super.viewDidLoad()
self.tabBar.barTintColor = UIColor(red:0/255, green: 209/255, blue: 204/255, alpha: 1)
// set selected icon background color
let numberOfItems = CGFloat(tabBar.items!.count)
let tabBarItemSize = CGSize(width: tabBar.frame.width / numberOfItems, height: tabBar.frame.height)
tabBar.selectionIndicatorImage = UIImage.imageWithColor(color: UIColor(red: 255/255, green: 255/255, blue: 255/255, alpha: 1), size: tabBarItemSize).resizableImage(withCapInsets: UIEdgeInsets.zero)
// remove default border
tabBar.frame.size.width = self.view.frame.width + 4
tabBar.frame.origin.x = -2
tabBar.tintColor = UIColor(red:65/255, green: 174/255, blue: 168/255, alpha: 1)
tabBar.unselectedItemTintColor = UIColor.white
解决方案
推荐阅读
- c# - 附加到之前启动的异步进程
- java - 错误:“JSONArray 文本必须在 1 [字符 2 第 1 行] 处以 '[' 开头”不适用
- c++ - 在 Qt MinGW 编译器中处理 __event
- powershell - 使用 PowerShell 提取文件名的一部分
- r - 在 R 中分解数据
- mysql - MySQL - 在多个模式中搜索特定值
- php - 在 PHP/Apache/Ubuntu 上运行长进程
- ios - UITableView 具有表格及其单元格的动态高度
- php - jquery datepicker is not working 控制器PHP中存在文本框
- java - Java 正则表达式。不包括分隔符的组