创建button设置可以折行显示
- (void)viewDidLoad {
[super viewDidLoad];
UIButton * button = [[UIButton alloc] initWithFrame:CGRectMake(20, 30, 150, 70)];
[self.view addSubview:button];
[button setTitle:@"button" forState:UIControlStateNormal];
[button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
//button 折行显示设置
/*
NSLineBreakByWordWrapping = 0, // Wrap at word boundaries, default
NSLineBreakByCharWrapping,// Wrap at character boundaries
NSLineBreakByClipping,// Simply clip 裁剪从前面到后面显示多余的直接裁剪掉
文字过长 button宽度不够时: 省略号显示位置...
NSLineBreakByTruncatingHead,// Truncate at head of line: "...wxyz" 前面显示
NSLineBreakByTruncatingTail,// Truncate at tail of line: "abcd..." 后面显示
NSLineBreakByTruncatingMiddle// Truncate middle of line: "ab...yz" 中间显示省略号
*/
bu