使用initwithcustomview
设置button的title时,即使设置了frame,button的大小还是不受控制,会根据字体多少,自动改变frame
需要设置
[button.widthAnchor constraintEqualToConstant:35].active = YES;
[button.heightAnchor constraintEqualToConstant:35].active = YES;
使用initwithcustomview
设置button的title时,即使设置了frame,button的大小还是不受控制,会根据字体多少,自动改变frame
需要设置
[button.widthAnchor constraintEqualToConstant:35].active = YES;
[button.heightAnchor constraintEqualToConstant:35].active = YES;