原因:设置 UITabBarItem 的 imageInsets 有问题。
top 与 bottom 的偏移量的绝对值要相等
例如:以下代码在iOS10会出现问题(变形,点击拉伸)
item.imageInsets = UIEdgeInsetsMake(-2, 0, 0, 0);
修正后,不会出现问题了:
item.imageInsets = UIEdgeInsetsMake(-2, 0, -2, 0);
原因:设置 UITabBarItem 的 imageInsets 有问题。
top 与 bottom 的偏移量的绝对值要相等
例如:以下代码在iOS10会出现问题(变形,点击拉伸)
item.imageInsets = UIEdgeInsetsMake(-2, 0, 0, 0);
修正后,不会出现问题了:
item.imageInsets = UIEdgeInsetsMake(-2, 0, -2, 0);
本文标题:iOS 10 TabbarItem变形,点击拉伸问题
本文链接:https://www.haomeiwen.com/subject/yiflvktx.html
网友评论