如何使用 Interface Builder 在 UIButton 中逐行居中文本?我正在搜索选项,只是没有看到它。这是按钮:
最佳答案
您不能将文本设置为在 Nib 居中。但是您可以更改代码中的对齐方式:
- (void)viewDidLoad {
[super viewDidLoad];
self.myButton.titleLabel.textAlignment = UITextAlignmentCenter;
}
关于iphone - 使用 IB 在 UIButton 上居中多行文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9035246/