有没有办法改变 UIToolbar 的高度? [英] Is there a way to change the height of a UIToolbar?

查看:39
本文介绍了有没有办法改变 UIToolbar 的高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Interface Builder 中有一个 UIToolbar 并且我注意到它被锁定为 44px 高.我当然想让这个更大.

I've got an UIToolbar in Interface Builder and I've noticed that it's locked to being 44px tall. Of course I'd like to make this larger.

Apple 是否允许调整此控件的大小?如果是这样,我该怎么做?

Does Apple allow resizing of this control? If so, how do I go about it?

推荐答案

当然,只是设置不同的框架:

Sure, just set its frame differently:

[myToolbar setFrame:CGRectMake(0, 50, 320, 35)];

这将使您的工具栏高 35 像素.当然,这需要一个 IBOutlet 或以编程方式创建 UIToolbar,但这很容易做到.

This will make your toolbar 35 pixels tall. Of course this requires an IBOutlet or creating the UIToolbar programmatically, but that's very easy to do.

这篇关于有没有办法改变 UIToolbar 的高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆