无法在 iPhone 应用程序中显示搜索栏
我试图让搜索栏显示在我的应用程序中。
我正在按照 TableSearch 示例应用程序中的示例进行操作。
除了数据之外,我或多或少以完全相同的方式实现了它。然而,我似乎永远无法显示实际的搜索栏。
我的应用程序和 TableSearch 应用程序之间的唯一区别是我的应用程序同时使用选项卡栏和导航栏。然而,我已经将它们侵入到 TableSearch 中,它仍然按预期工作。
有什么建议吗?还有其他人遇到过类似的问题吗?这让我发疯。
提前致谢, 马特
I've trying to get a search bar to display in my application.
I'm following the example show in the TableSearch sample application.
I've more or less implemented it exactly the same way apart from the data. I however can never seem to get the actual search bar to display.
The only other difference between my app and the TableSearch app is that mine uses both a tab bar and navigation bar. However I've hacked these into the TableSearch and it still works as expected.
Any suggestions? Anyone else had similar problems to this? This is driving me crazy.
Thanks in advance,
Matt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是总结一下我做错了什么以及如何解决它。
这是我之前在代码中的内容:(
注意:我也有一个 SearchController.xib)
这似乎工作正常,即 nib 文件已加载并工作,但搜索栏从未显示。
当我将上面的内容更改为:
它按预期工作。
因此,从我的错误中吸取的教训是 - 如果您使用 nib 文件 - 明确指定它。
希望对您有帮助,
马特
Just to summarise what I was doing wrong and how I fixed it.
This is what I had previously in my code:
(Note: I have a SearchController.xib too)
Which seemed to work fine i.e the nib file loaded and worked except the search bar never displayed.
When I changed the above to:
It worked as expected.
So the lesson to learn from my mistake is - if you're using a nib file - specify it explicitly.
Hope that helps you,
Matt