简体   繁体   中英

Swift - button item iOS 11

I created 2 right button item in my navigation Controller. Since I updated to iOS 11, the content inset of icons has changed and I really don't know why ...

This this the difference between iOS 10 (Left) and iOS 11 (right):

在此处输入图片说明

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 ...

 editButton.translatesAutoresizingMaskIntoConstraints = NO;  

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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