UISearchBar 框架使 x 难以按下
我的 UINavigationBar 中有一个 UISearchBar,其中也有一个按钮。当您单击搜索字段时,按钮会变大一点以容纳文本,而搜索字段会变小以为其腾出空间。
尽管就视觉 UI 而言这看起来很完美,但用于清除搜索字段的 x 几乎无法单击。
来设置框架
self.navigationController.navigationBar.bounds;
我通过每次改变尺寸 。我应该使用什么来使搜索栏的 x 可以点击?
为任何帮助干杯
I have a UISearchBar in my UINavigationBar that also has a button in it. When you click the search field the button gets a bit larger to accommodate text and the search field gets smaller to make space for it.
Although this looks perfect as far as visual UI is concerned the x to clear the search field is almost unclickable.
I am setting the frame by doing
self.navigationController.navigationBar.bounds;
every time the size is meant to change. What should I use instead so that the search bar's x is clickable?
Cheers for any help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,简单的解决方案,我应该设置边界而不是框架
Well simple solution, I should be setting the bounds rather than the frame