问题标签 [uisearchbar]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
iphone - UISearchBar 和 UINavigationItem
我似乎无法让 UISearchBar 将自己从导航栏中的最左侧定位到最右侧。在 -(void)viewDidLoad 方法中,我有以下代码:
当您构建并运行时,乍一看它看起来还不错。但是,仔细观察,您可以看出左侧有一个边距/空间。这在宏伟的计划中没什么大不了的,但是当我点击搜索栏开始搜索时,我会将取消按钮设置为动画。因为搜索栏的位置稍微偏右,所以动画很生涩,取消按钮会像这样掉下来: link text
似乎 UINavigationItem 就像一个包含三个单元格的表格,其中第一个和最后一个有一个我无法删除的填充 - 似乎也没有办法将它们“合并”在一起然后放置那里的搜索栏。我知道这种外观是可能的,因为 AppStore 搜索在导航栏中有一个搜索栏,它一直延伸到边缘。任何人都知道如何让搜索栏一直走到边缘,这样我的滑入式取消按钮动画才能正常工作?
uisearchbar - UISearchBAR scopeBar tintColor
有没有人设法为 UISearchBar 的范围栏部分着色,它有一个 tintColor 属性,但设置它不会影响附加的范围栏 UISegmentedControl。我在酒吧上有一个把手可以给它上色,但似乎不起作用,即:
干杯,尼尔
ios - 点击空的 UITableView 退出搜索栏
我有一个顶部带有搜索栏的表格视图。当我点击搜索时,它会被呼叫到第一响应者并出现键盘。搜索栏有一个取消按钮,但是当表格为空时,我希望用户能够点击空表格行上的任意位置以将搜索栏和键盘作为第一响应者。我该怎么做呢?
iphone - 调用 cancelButton 后隐藏 UINavigationBar 下面的 UISearchBar
我通常使用[self.tableView setContentOffset:CGPointMake(0,40)];
它来隐藏导航栏下方的 UISearchBar(我设置为 tableView 的标题)。viewDidLoad 中一切正常:加载视图时,searchBar 位于 navigationBar 下方。然后我把同一行代码
在
但它可以做任何事情:当单击取消按钮时,searchBar 仍然可见。怎么了?
iphone - 在 UISearchBar 中单击会导致内存泄漏
我遇到了奇怪的内存泄漏,我只是查明了是什么原因造成的。我正在使用具有主视图和反面视图的实用程序应用程序。当您处于反面视图时,您可以通过单击加号按钮来呈现另一个模式视图。这个视图有一个 UISearchBar 和 UITableView。单击 UISearchBar 时会产生内存泄漏,并显示以下信息:
替代文字 http://img340.imageshack.us/img340/6175/picture4ux.png
为什么单击此栏会产生这种情况?任何帮助将不胜感激。
iphone - 像在邮件应用程序中一样在 UISearchBar 中搜索时选定项目的气泡
当您在“收件人:”字段中输入新地址时,我想实现类似于 iphone 邮件应用程序中发生的事情:当您开始搜索匹配地址列表时(我知道该怎么做)以及当您选择一个时然后会出现一个带有地址的气泡,您可以继续添加地址(我不知道该怎么做)。
有什么提示吗?
iphone - 帮助 UISearchBar 方法
所以我无法在我的应用程序中实现搜索栏。
这些方法会找到过滤后的项目,但由于某种原因,它们不会出现在我的表格视图中。我认为这与将对象添加到过滤列表内容数组有关。
我应该添加什么对象才能使它起作用。
这是我的代码:
最后一个 NSLog 每次都读取(null),但它上面的 NSLog 总是显示正确的过滤项。
iphone - 搜索栏委托 - searchBarShouldBeginEditing / searchBarTextDidBeginEditing 之间的区别?
他们之间有什么区别?在我的实验中,它们似乎在相同的操作中被调用——一旦用户点击搜索栏以调出键盘。尽管用户还没有编辑实际文本。这似乎调用了searchBar:textDidChange。但是,每次更改都会调用它,而不仅仅是在开始时一次。这意味着我必须编写更多代码来复制搜索栏在 Google 地图中的行为方式。
好的,所以这更多地变成了发泄 - 但也许我错过了一些东西。是否存在调用 searchBarShouldBeginEditing 但不调用 searchBarTextDidBeginEditing 的情况 - 反之亦然?
iphone - iPhone UISearchBar & keyboard外观
当键盘出现时,我想设置
我检查了文档,看起来你只能更改键盘类型。
这可以在不违反任何 Apple 私有 API 的情况下完成吗?
iphone-sdk-3.0 - UISearchBar in a UITableView
I'm trying to mimic the behaviour of a table view similar to the iPod app for Artists - it's a sectioned table view with a section index on the right, with a search bar at the top, but initially hidden when view shown.
I am using sdk 3.1.2 and IB, so simply dragged a UISearchDisplayController
into my NIB - it wires everything up for searching. The problem starts because I'm adding the UISearchBar
to the first section of the UITableView
, because if I understand correctly I must do this so I can jump to the search bar by touching the search icon in the section index directly? When the table view appears I see the search bar but it has resized and I now have a white block behind the section index at the top. It doesn't take the color of the UISearchBar
's surround which interestingly is different to that shown in Interface Builder.
I found a tip to add a small navigation bar and a UISearchBar
in a UIView
, then add this to the table view cell. This works, but the color of the navigation bar's background is what you'd expect normally (gray), not the different color as noted above. More interesting, if I tap the search bar to start a search, then tap Cancel, all is fixed. The background along the whole tableview cell when the search bar is, is the same?