如何调整UIButton里面的文字位置以及按钮文字右对齐
1个回答
2014-12-27
展开全部
CGRect btnRect = CGRectMake(
360 * 0.5f,
352 * 0.5f,
107,
49
);
m_iknowBtn = [[UIButton alloc] initWithFrame:btnRect];
[m_iknowBtn setTitle:FoolLocalizedString(@"知道了", nil) forState:UIControlStateNormal];
[m_iknowBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
m_iknowBtn.titleLabel.font = [UIFont systemFontOfSize:18];
m_iknowBtn.titleLabel.adjustsFontSizeToFitWidth = YES;
m_iknowBtn.titleLabel.minimumFontSize = 5;
[m_iknowBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 10, 18, 0)];
[m_iknowBtn setBackgroundImage:[UIImage imageNamed:@"ipad_goodluck_iknow_btn.png"] forState:UIControlStateNormal];
[m_iknowBtn addTarget:self action:@selector(closeLayer) forControlEvents:UIControlEventTouchUpInside];
360 * 0.5f,
352 * 0.5f,
107,
49
);
m_iknowBtn = [[UIButton alloc] initWithFrame:btnRect];
[m_iknowBtn setTitle:FoolLocalizedString(@"知道了", nil) forState:UIControlStateNormal];
[m_iknowBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
m_iknowBtn.titleLabel.font = [UIFont systemFontOfSize:18];
m_iknowBtn.titleLabel.adjustsFontSizeToFitWidth = YES;
m_iknowBtn.titleLabel.minimumFontSize = 5;
[m_iknowBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 10, 18, 0)];
[m_iknowBtn setBackgroundImage:[UIImage imageNamed:@"ipad_goodluck_iknow_btn.png"] forState:UIControlStateNormal];
[m_iknowBtn addTarget:self action:@selector(closeLayer) forControlEvents:UIControlEventTouchUpInside];
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询