UISegmentedControl不扩展导航栏的大小/非常挤压 [英] UISegmentedControl not expanding size for navigation bar/very squished

查看:172
本文介绍了UISegmentedControl不扩展导航栏的大小/非常挤压的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行iPhone SDK书和其中一个示例让我创建一个表,然后在表中添加 UISegmentedControl 进行排序。

Running through an iPhone SDK book and one of the examples has me creating a table and then later adding a UISegmentedControl to the table for sorting.

我在IB中尽职尽责,看起来很棒:

I dutifully did this in IB, and it looks great:

IB截图http://img.skitch.com/20100529-83sefni21q4nj51rw1mghh2yj1.jpg

当我在模拟器或手机中运行它时,它完全被压扁了:

When I run it in the simulator or my phone, it's totally squished:

Squished http://img.skitch.com/20100529-x3pmr7gkb6xpm766bupi7quy55.jpg

按钮工作正常,它只是他们根据他们的内容没有调整大小。有什么想法会出错吗?

The buttons work perfectly, it's just they are not sizing according to their content. Any ideas what's going wrong?

这是我设定的属性:

属性http://img.skitch.com/20100529-tp4d69bk8x98c6sjpmcne92etb.jpg

推荐答案

好的,所以在尝试实现@Chris Gummer的答案时,我似乎已经了解了有关Size-> View Size属性面板如何工作的更多信息。默认值为:

OK, so in attempting to implement @Chris Gummer's answer, I seem to have learned more about how the Size->View Size property panel works. The default is:

默认大小调整http ://img.skitch.com/20100529-gg9dwq5em3557yb1d6d721hpn4.jpg

这似乎不是一个好的默认值。我的书没有提到需要调整这个,所以我没有看。设置框的内部水平箭头(我猜这意味着适合宽度到可用空间)就可以了:

and this is not a good default, it would seem. My book didn't mention needing to adjust this, so I didn't look at it. Setting the inner horizontal arrow of the box (which I guess means "fit width to available space") did the trick:

答案http://img.skitch.com/20100529-xt1bqghb4kbm2pbcqf1i1uygab.jpg

这篇关于UISegmentedControl不扩展导航栏的大小/非常挤压的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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