Xcode 4 导航项提示属性行为异常?
在 Interface Builder 中进行设计并向提示属性添加文本时,它会创建一个附加的顶部标题。这需要额外的厚度,以便在导航栏中容纳 2 个图块。
一旦我删除文本,假设重置回原来的样子,即使那里没有文本,它也会保持该厚度。在运行时切换视图会使栏增大和缩小,这不太好。
我的问题是,如何将其重置回默认的单线粗细栏?
谢谢 吉姆
When designing in Interface Builder and you add text to a prompt property, it creates an additional top title. This comes with the extra thickness needed to allow for 2 tiles in the navigation bar.
Once I remove the text, let's say to reset back to the way it was, it keeps that thickness even though there is no text there. At runtime switching views makes the bar grow and shrink, which isnot nice.
My question is, how do you reset this back to a default single line thickness bar?
Thank you
Jim
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
万一其他人遇到此问题...2 个选项
1 修复 xib direct 中未删除的 xml
解决方法,如果这是一个错误,则编辑 *.xib 文件...作为 xml,您可以删除留下的条目,似乎重置没有问题...
例如,为了确保安全,请添加“FOO BAR”之类的值,然后在文本编辑器中搜索该值以找到密钥。
(采取常规备份和维护,当然风险自负)
(将在线错误提交给苹果进行评估)
2 由 Drew C 建议的运行时程序修复
即设置 self.navigationItem.prompt = nil
In case anyone else has this problem...2 options
1 Fix unremoved xml in xib direct
A workaround, if this is a bug is to edit the *.xib file...as xml you can delete the entry left behind and seems to reset without issue...
e.g. To be sure, add value like "FOO BAR" and search for that in the text editor to find the key.
(take usual backup & care & own risk ofcourse)
(submitted online bug to apple for assessment)
2 Runtime programatic fix suggested by Drew C
i.e. set self.navigationItem.prompt = nil
在 IB 的属性检查器窗格中,将顶部栏的值更改为“导航栏”而不是“带提示的导航栏”
编辑:参见下面的照片 -
In the Attributes Inspector pane of IB, change the value for Top Bar to "Navigation Bar" instead of "Navigatin Bar with Prompt"
Edit: See photo below-