uisearchbar

UISearchController: searchBar and scopeBar overlap on first touch event

為{幸葍}努か 提交于 2019-12-03 08:27:44
I'm trying to implement a simple search bar using Apple's latest UISearchController. However I can't seem to get it to work correctly if I use the search bar's scope bar to get a filter choice. The scope bar always shows which I could live with but on the very first touch event the search bar and scope bar overlap. I used Apple's TableView sample code app but it didn't change anything. - (void)viewDidLoad { [super viewDidLoad]; _resultsTableController = [[APLResultsTableController alloc] init]; _searchController = [[UISearchController alloc] initWithSearchResultsController:self

How to implement Search Bar like gmail app in android? [closed]

帅比萌擦擦* 提交于 2019-12-03 08:26:55
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am trying to implement the Search functionality in my android app similar to latest gmail app (search icon in the action bar). On tapping the Search icon, the action bar turns into a search field with a back button on the left side, and a microphone button on the right side. I want to have the same component

How can i make a more rounded UITextField? Like the search field in Safari on iPad

混江龙づ霸主 提交于 2019-12-03 07:32:00
HI I'm trying to get a UITextField to look like the google search field available in the safari app on iPad. The purpose of the field will be the same (a search box). I know i could use a UISearchBar but I would have to use hackish code to get rid of the magnifying glass icon and the background and I don't want that. I'm attaching an image with the TextField used by apple as their search box. How can I modify an UITextField to look and behave like the search field in this screenshot? I tried to modified the UITextField's layer roundedCorners property but this doesn't work as expected. Any help

Animating the width of UISearchBar frame

限于喜欢 提交于 2019-12-03 07:28:41
问题 Is it possible to animate the frame width of a UISearchBar? I find when I apply uiview animations to widen the bounds of a search bar it pops immediately to the final result as if the object internally is assuming control of how it animates and not allowing me to apply my own animations to it smoothly. If I animate the position it moves smoothly, but I suspect the fact that the text input adjusts according to the presence of the cancel button might mean we don't have public access to animate

Why is this UISearchBar getting resized?

纵饮孤独 提交于 2019-12-03 07:23:12
As shown below, my UISearchBar is getting resized when I tap on the search field. It animates nicely to cover the navigation bar, and then pop... it shrinks. The setup The UISearchBar is inside a vanilla UIView set as the tableHeaderView . I'm using a UIView (as opposed to setting the UISearchBar as the header) because I would like to put additional views in the header. The view is defined in a XIB file and the UISearchBar is anchored to all of its borders. The constraints don't seem to matter; if I remove them, the same problem happens. Experiments Examining the view hierarchy in Reveal tells

UISearchBAR scopeBar tintColor

▼魔方 西西 提交于 2019-12-03 07:15:16
问题 Has anyone managed to color the scopebar portion of a UISearchBar, it has a tintColor property but setting it does not affect the attached scopebar UISegmentedControl. Ive got a handle on the bar to tint it but doesnt seem to work ie: for (id subview in searchBar.subviews){ if([subview isMemberOfClass:[UISegmentedControl class]]){ UISegmentedControl *scopeBar=(UISegmentedControl *) subview; scopeBar.tintColor=UIColorFromRGB(0x990066); } } Cheers, Neil 回答1: This is interesting, turns out the

how to change UISearchBar from round to rectangle?

陌路散爱 提交于 2019-12-03 07:03:32
i will like to know how do i need to change a UISearchBar from the default round curve to a rectangle. Keller for (UIView *searchBarSubview in [mySearchBar subviews]) { if ([searchBarSubview conformsToProtocol:@protocol(UITextInputTraits)]) { @try { [(UITextField *)searchBarSubview setBorderStyle:UITextBorderStyleRoundedRect]; } @catch (NSException * e) { // ignore exception } } } Swift 4: mySearchBar.subviews().forEach { searchBarSubview in if searchBarSubview is UITextInputTraits { do { (searchBarSubview as? UITextField)?.borderStyle = .roundedRect } catch { // ignore exception } } } Simple

How to change the position or hide magnifier icon in UISearchBar in IOS 7?

流过昼夜 提交于 2019-12-03 06:58:08
问题 I am working on IOS 7 application.By default its appearing like Pic(1).But I need to change it as Pic(2).I googled and found few answers for the requirement,but it has not changed.Or else I need to hide.So that I can manage with background image.This is first image I used below code to modify it.But didnt succeed. In .h file @property(nonatomic,strong) IBOutlet UISearchBar *findSearchBar; In .m file @synthesize findSearchBar; - (void)viewDidLoad { [super viewDidLoad]; [self

How to filter UICollectionView and keep keyboard up?

寵の児 提交于 2019-12-03 05:47:55
I've added a UISearchBar to a UICollectionView and in the delegate searchBar:textDidChange: filter my model and call [collectionView reloadData] . reloadData (as well as reloadSection, etc) wants to take away firstResponder from the searchbar's textfield, thus dismissing the keyboard. I am trying to build a "live updating" filter and so it's annoying to have the keyboard go away after each character typed. Any ideas? In searchBar delegate function , I use performBatchUpdates, first,reload collectionView then call [self.searchBar becomeFirstResponder] to display keyboard - (void

Can't change search bar tint color to be transparent in iOS 8

人盡茶涼 提交于 2019-12-03 05:23:17
Upgraded from Xcode 5 to 6 and now my search bar tint is black. Tried to change it through storyboard right pane > "Bar Tint" to clear color, but it's still black. Also tried programmatically: [self.searchBar setTintColor:[UIColor clearColor]]; Still black :( Any ideas? Mike The tintColor property on search bars, much like UINavigationBar, changes the color of the buttons, as well as changes the color of the blinking cursor, not the actual search bar background. What you want to use is the barTintColor property. searchbar.barTintColor = [UIColor orangeColor]; searchbar.tintColor = [UIColor