uisearchbar

uisearch bar width is reduced when change orientation from landscape to portrait

非 Y 不嫁゛ 提交于 2019-12-11 19:17:06
问题 I am using tableview with search bar display controller, it shows good in portait and landscape view, but rotate from landscape to portrait search bar size is reduced, how to change the original size 回答1: The first your should catch the orientation: //AppDelegate.h @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (nonatomic, unsafe_unretained) NSInteger isPortrait; //AppDelegate.m @synthesize isPortrait; - (BOOL)application:(UIApplication *)application

Search bar is not getting fixed on iPhone

限于喜欢 提交于 2019-12-11 18:39:55
问题 I've two issues: I have a search bar in my iPhone screen. When I scroll my screen then my searchbar also gets scrolled. I want to fix this or make it absolute. Searching is not working like If I enter A then I should get all words that start with alphabet A. Code that I'm trying: - (void)viewDidLoad { [super viewDidLoad]; const NSInteger searchBarHeight = 45; UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, searchBarHeight)];

how to create a searchbar like in the weather app?

淺唱寂寞╮ 提交于 2019-12-11 18:18:34
问题 in my app I want to have a searchbar like in the weather app when you add a new city. I also want to search for citys/places with google geocoding and parse the results I already knkow how to do that works perfect. for this actually I have two questions. first how do I create a searchbar that looks like the one in the weather app or the stokes app? a normal searchbar does not have a topic which i can work with. How did they do that ? and second how can I become that instant/live search

Why am I getting duplicate rows in tableview when user types fast in searchfield?

倾然丶 夕夏残阳落幕 提交于 2019-12-11 16:49:40
问题 I have built a search view controller that searches for users, once the user has typed at least 2 letters. It works great, and no problems and issues when the user types slow. However if the user types fast into the search field, the results show up, however, the user gets displayed in two rows (duplicate rows). How can I fix this? This is my code @IBOutlet var tableView: UITableView! var isSearching = false private var viewIsHiddenObserver: NSKeyValueObservation? let searchController =

UISearchBar not looking for information in TableView

删除回忆录丶 提交于 2019-12-11 14:12:57
问题 I try to fetch data from firebase and show in tableView . Everything is good. But I need to search in tableView using UISearchBar . I should to solve two problems. 1) When I start typing my tableView disappears. all the information in it is not displayed 2) When I erase everything in UISearchBar , nothing appears. import UIKit import SPStorkController import Firebase class FoodViewController: UIViewController { override var preferredStatusBarStyle: UIStatusBarStyle { return .lightContent }

Search for multiple words ignoring the order in Swift 5

天大地大妈咪最大 提交于 2019-12-11 14:08:27
问题 In my app I built a SearchBar which, for a single word, works perfectly fine. import Foundation class Clinic { var id = "" var name = "" var address = "" var specialty1 = "" var specialty2 = "" } In my textDidChange I have var clinics: [Clinic] = [] // Clinics Data Structure var clinicsSearch: [Clinic] = [] // Filtered Clinics func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { // works for one word (either in name or specialty1 or specialty2) clinicsSearch = clinics

PFObject compare:options:range error when searching parse.com class

半腔热情 提交于 2019-12-11 13:59:36
问题 I am trying to make a search query from a Parse.com class, in my collection view, through a UISearchBar. When I try to search it crashes and gives me the error below. Is there a better way to make a search function to a collection view, and if not, what am I doing wrong? Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PFObject compare:options:range:]: unrecognized selector sent to instance 0x1741366c0' Here's the code: @implementation DiscoverViewController

UISearchbar using UItextfield in swift 4

冷暖自知 提交于 2019-12-11 11:13:49
问题 I am working on JSON. My Json data print into the tableview. I want to filtered that data with searchbar. So I put Textfield for using the Searchbar. I use reference from this website http://findnerd.com/list/view/How-to-create-your-own-search-bar-in-Swift-Not-using-UISearchBar/20577/ My Search bar is working but not properly. I want to filter data after I write 3 Words in searchbar.If I write "Ku" then my tableview remain hide. If I write "kus" in searchbar then searchbar started searching

Animate UISearchBar and UIBarButtonItem simultaneously with UISearchController

[亡魂溺海] 提交于 2019-12-11 10:39:51
问题 I'm trying to reproduce a search interface similar to the one of the Maps app. I'm using a UISearchController with its searchBar inside my navigationBar . I also have a rightBarButtonItem on that navigation bar. By default, when presenting the search controller, the cancel button of the search bar shows next to the existing right item. What I want to do — like with the Maps app — is to hide my right navigation item while the searchController is presented and show it again when it's dismissed.

UISearchBar customization code crashes in iOS7, works on iOS6

落花浮王杯 提交于 2019-12-11 10:39:23
问题 I have an iOS application, built to support iOS5.1, and I was customizing the cancel button inside search bars. The code I'm using and that works until iOS6.1 is the following: id barButtonAppearanceInSearchBar = [UIBarButtonItem appearanceWhenContainedIn: [UISearchBar class], nil]; [barButtonAppearanceInSearchBar setTitle: [self localizedStringValueFor:@"Cancel"]]; Somehow the second line will cause a bad access exception, the barButtonAppearanceInSearchBar seems to be deallocated when I try