加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

objective-c – 更改UIStepper的大小

发布时间:2020-12-16 10:22:50 所属栏目:百科 来源:网络整理
导读:我似乎无法改变UIStepper的大小: 在IB中,“宽度”和“高度”框显示为灰色. 我使用了initWithFrame: UIStepper * stepper = [[UIStepper alloc] initWithFrame:CGRectMake(300,638,120,80)]; 但它不会改变大小.关于SO的几个帖子似乎暗示它是可变的.有什么
我似乎无法改变UIStepper的大小:

>在IB中,“宽度”和“高度”框显示为灰色.
>我使用了initWithFrame:

UIStepper * stepper = [[UIStepper alloc] initWithFrame:CGRectMake(300,638,120,80)];

但它不会改变大小.关于SO的几个帖子似乎暗示它是可变的.有什么建议吗?

解决方法

来自文档:

The bounding rectangle for a stepper matches that of a UISwitch object.

听起来不像前面那样可能.

也在这blog post:

// Frame defines location,size values are ignored
UIStepper *stepper = [[UIStepper alloc] initWithFrame:CGRectMake(120,20,0)];

但你可以尝试transform it’s layer.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读