gpt4 book ai didi

iphone - UIButton 文本边距/填充

转载 作者:行者123 更新时间:2023-12-03 18:09:33 25 4
gpt4 key购买 nike

我有以下布局,我正在尝试向左侧和右侧添加填充..

这些控件是一个禁用的 UIButton。

enter image description here

我创建按钮的代码是这样的:

UIButton *buttonTime = [[UIButton alloc] initWithFrame:CGRectMake(90, 10, 50, 20)]; 
[buttonTime setBackgroundImage:[[UIImage imageNamed:@"bubble.png"] stretchableImageWithLeftCapWidth:9 topCapHeight:13] forState:UIControlStateDisabled];

[buttonTime setTitle:@"27 feb, 2011 11:10 PM" forState:UIControlStateDisabled];
[buttonTime setTitleColor:[UIColor blackColor] forState:UIControlStateDisabled];
buttonTime.titleLabel.font=[UIFont fontWithName:@"Helvetica" size:8.0];
buttonTime.titleLabel.lineBreakMode= UILineBreakModeWordWrap;
[buttonTime setEnabled:FALSE];
[scrollView addSubview:buttonTime];
[buttonTime release];

最佳答案

您还可以从 Storyboard 或 xib 内的 Interface Builder Size Inspector 设置插入值。

Interface Builder Size Inspector

关于iphone - UIButton 文本边距/填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5363789/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com