iOS UIBarButtonItem 固定尺寸

自定义UIBarButtonItem的时候发现 有时候UIBarButtonItem尺寸会发生变化 通过以下方式可以很好的解决问题

[button.widthAnchor constraintEqualToConstant:(80)].active = YES;
[button.heightAnchor constraintEqualToConstant:(26)].active = YES;
[[UIBarButtonItem alloc] initWithCustomView:button];
原文地址:https://www.cnblogs.com/qqcc1388/p/12068732.html