uisearchbar

uitableview reloadData issue

谁说我不能喝 提交于 2019-12-21 22:41:43
问题 I've been debugging my iphone app and found something interesting. I have a UIViewControllers with TabBarcontroller( 6 tabs). Each tab is a UIViewController and it has a UITtableview. The viewDidLoad works and brings the initial data. On of the UITableView has a search bar. After the user touchs presses search some magic happens and I get an array with data. I cant see the new data in the tableview and the [tableView reloadData] has no effect outside viewDidLoad (first time). I can see the

UISearchBar does not display Cancel button when added as subview to UINavigationBar

[亡魂溺海] 提交于 2019-12-21 21:25:06
问题 I'm following the answer at https://stackoverflow.com/a/14235624/855680 to animate my UISearchBar which starts off with a smaller width, then expands to the full width of the iPhone screen when active. It expands as expected, except that the Cancel button does not appear at all. I've tried calling setShowsCancelButton:animated in both searchBarTextDidBeginEditing: and searchDisplayControllerWillBeginSearch: , but to no avail. What am I missing? Here's my code: HomeViewController.h #import

Swift: Have SearchBar search through both sections and not combine them

♀尐吖头ヾ 提交于 2019-12-21 20:56:52
问题 Using Swift 3, the app is a blog reader reading from a MYSQL database using PHP and JSON. Currently my SearchBar is not doing what I want, I have it searching in my mainArray (section 1) with the 'All' scope. As it's being filtered the objects that are being filtered are moved to filteredArray. I did this in the mean time because I can not figure out how to make it do what I want. What it's supposed to do is this, when the user is searching for an object, I want the object to show up wether

Programmatically activating UISearchBar blocks user interactions with it

僤鯓⒐⒋嵵緔 提交于 2019-12-21 20:50:30
问题 I have a simple table view inside a navigation controller with the toolbar visible. On the toolbar is a search button, and the table view's table header view is set to my UISearchBar . If I scroll the table view up and then tap on the search bar to activate it, everything happens normally. But if I tap on the search button, which activates search bar programmatically, then all interactions with the search bar are disabled (looks like it's blocked by something), and the user can't clear the

UISearchBar width doesn't change when its embedded inside a UINavigationBar

落爺英雄遲暮 提交于 2019-12-21 17:32:05
问题 I'm experimenting with the new UISearchController API introduced in iOS 8. Although the API is new, it uses the same old UISearchBar . I added it to the UINavigationController 's titleView . import UIKit class ViewController: UIViewController, UISearchBarDelegate { override func viewDidLoad() { super.viewDidLoad() let searchController = UISearchController(searchResultsController: nil) searchController.hidesNavigationBarDuringPresentation = false searchController

Can background or borders be removed from UISearchBar?

倖福魔咒の 提交于 2019-12-21 17:04:45
问题 I'd like to get something like this: But I was not able to remove original background (I'm using iOS5). However, it seems Apple did it: How can I create what I want? Or, there is no choice and the only alternative I have is customize a UITextField? Thanks for suggestions and ideas! EDIT: After first reply, this is what I got: Does anyone how can I remove white inner background without making all component semitransparent changing its alpha value? BTW, can I change white color by black color?

make UItextfield to function like UISearchBar

放肆的年华 提交于 2019-12-21 13:01:49
问题 I want to change the looks of UISearchBar : So, If there's a way by which I can make my UITextField (in a custom background for search) to function like UISearchBar ? or subclassing and overriding the - (void)layoutSubviews is the only way ? Kindly tell How to subclass it !!! 回答1: you can change the UISearchBar background using this bellow code.. for (UIView *subview in searchBar.subviews) { if ([subview isKindOfClass:NSClassFromString(@"UISearchBarBackground")]) { UIView *bg = [[UIView alloc

Make UISearchController search bar automatically active

让人想犯罪 __ 提交于 2019-12-21 09:40:40
问题 I've implemented a UISearchController with its search bar in a navigatiom bar and I would like to make the search bar active when the view is loaded. When I say active, I mean that the keyboard appears and the user can type his/her search without tap the search bar. I initialised the UISearchController with the following code: - (void)viewDidLoad { self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; [self.searchController setSearchResultsUpdater:self];

UISearchBar with UISearchDisplayController animates outside screen

六眼飞鱼酱① 提交于 2019-12-21 06:06:08
问题 I have standard iPad view controller which has a custom navigation bar at the top. In the xib-file I've added a UISearchBar aligned to the right edge of the view. The search bar is 320px in width. I init a searchdisplaycontroller like this: // Search display controller self.mySearchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:_searchBar contentsController:self]; _mySearchDisplayController.delegate = self; _mySearchDisplayController.searchResultsDataSource = self;

UISearchBar inputAccessoryView

旧街凉风 提交于 2019-12-21 05:31:09
问题 The UISearchBar seems to have the inputAccessoryView as a readOnly property. How do I set it with my own customToolbar ? 回答1: Edit: As is mentioned in the comments below, this is no longer an issue post iOS 6. See the UISearchBar documentation here. The UIResponder (of which UISearchBar is an indirect subclass of) class documentation details a way to accomplish this: Subclasses that want to attach custom controls to either a system-supplied input view (such as the keyboard) or a custom input