草庐IT

UIControlStateNormal

全部标签

设置 UIButton 文字内容的位置与偏移量

设置UIButton文字内容位置的时候常会使用设置UILable的方式去对齐调试,但编译运行后发现文字样式并未能如愿以偿的改变,例如如下案例:修改前UIButton*btn=[UIButtonbuttonWithType:UIButtonTypeCustom];[btnsetBackgroundColor:[UIColorwhiteColor]];[btnsetTitle:@"隐私协议"forState:UIControlStateNormal];[btnsetTitleColor:[UIColorlightGrayColor]forState:UIControlStateNormal];bt