简体   繁体   English

Swift - 按钮项 iOS 11

[英]Swift - button item iOS 11

I created 2 right button item in my navigation Controller.我在导航控制器中创建了 2 个右键项目。 Since I updated to iOS 11, the content inset of icons has changed and I really don't know why ...自从我更新到 iOS 11 后,图标的内容插图发生了变化,我真的不知道为什么......

This this the difference between iOS 10 (Left) and iOS 11 (right):这是 iOS 10(左)和 iOS 11(右)之间的区别:

在此处输入图片说明

Do you have any idea about how I could change that ?你知道我该如何改变吗?

This is a piece of my code :这是我的一段代码:

 editButton.imageInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: -30)

It was good with this line in iOS 10 ...这行在 iOS 10 中很好......

 editButton.translatesAutoresizingMaskIntoConstraints = NO;  

iOS 11默认设置为YES ,尝试设置此属性,并调整按钮:

[editButton setContentEdgeInsets:UIEdgeInsetsMake(0, 0, 0, -30)];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM