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

查看:126
本文介绍了有没有办法改变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天全站免登陆