iOS 怎么让button的省略号在后面
如题,当button放不下这么多是字符时,会自动的把中间的字符打上省略号,怎么能让省略好打在最后面呢...
如题,当button放不下这么多是字符时,会自动的把中间的字符打上省略号,怎么能让省略好打在最后面呢
展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
1个回答
展开全部
UIButton *butt = [UIButton buttonWithType:UIButtonTypeCustom];
butt.frame = CGRectMake(100, 100, 100, 30);
[butt setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
butt.backgroundColor = [UIColor grayColor];
[butt setTitle:@"fsdfdsfdsfds" forState:UIControlStateNormal];
butt.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[self.view addSubview:butt];
butt.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;加上这句话就可以,uibutton有uilabel的方法
butt.frame = CGRectMake(100, 100, 100, 30);
[butt setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
butt.backgroundColor = [UIColor grayColor];
[butt setTitle:@"fsdfdsfdsfds" forState:UIControlStateNormal];
butt.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[self.view addSubview:butt];
butt.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;加上这句话就可以,uibutton有uilabel的方法
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询