美文网首页
UIBarButtonItem的button大小详解

UIBarButtonItem的button大小详解

作者: 葛朋1990 | 来源:发表于2019-11-10 18:15 被阅读0次

使用initwithcustomview
设置button的title时,即使设置了frame,button的大小还是不受控制,会根据字体多少,自动改变frame
需要设置

[button.widthAnchor constraintEqualToConstant:35].active = YES;
[button.heightAnchor constraintEqualToConstant:35].active = YES;

相关文章

网友评论

      本文标题:UIBarButtonItem的button大小详解

      本文链接:https://www.haomeiwen.com/subject/vhmabctx.html