public class UISearchBar extends UIView
NoIntrinsicMetric
Constructor and Description |
---|
UISearchBar()
Constructs a default UISearchBar object located at (0,0) with 0 weight
and 0 height.
|
UISearchBar(CGRect rect)
Constructs a UISearchBar object initialized with the dimensions and
position specified in the rect parameter.
|
Modifier and Type | Method and Description |
---|---|
int |
autocapitalizationType()
Returns the type of autocapitalization that is set for this text field.
|
int |
autocorrectionType()
Returns the type of autocorrection that is set for this text field.
|
int |
barStyle()
Returns the type of this search bar.
|
UIColor |
barTintColor()
Returns the color of the search bar background.
|
boolean |
becomeFirstResponder()
Returns a Boolean that shows whether this UIResponder accepts to change
its status to first responder.
|
UISearchBarDelegate |
delegate()
Returns the delegate object of this search bar that is the object
responsible for search bar's functionality.
|
boolean |
isTranslucent()
Returns a Boolean that shows whether the search bar is translucent.
|
int |
keyboardType()
Returns the keyboard type of the text field of this search bar.
|
String |
placeholder()
Returns the String that is displayed when there is no other text in the
text field of the search bar.
|
String |
prompt()
Returns the prompt text that is displayed above the search bar.
|
boolean |
resignFirstResponder()
Returns a Boolean that shows whether this UIResponder accepts to resign
its status as first responder.
|
List<String> |
scopeButtonTitles()
Returns a list with the titles of the scope buttons' titles.
|
int |
searchBarStyle()
Returns the style of this background of the search bar.
|
int |
selectedScopeButtonIndex()
Returns the index of the selected scope button.
|
void |
setAutocapitalizationType(int UITextAutocapitalizationType)
Sets the type of autocapitalization that will be applied to the text
field specified by the value of UITextAutocapitalizationType.
|
void |
setAutocorrectionType(int UITextAutocorrectionType)
Sets the type of autocorrection that will be applied to the text field
specified by the value of UITextAutocorrectionType.
|
void |
setBarStyle(int UIBarStyle)
Sets style of this search bar.
|
void |
setBarTintColor(UIColor tintColor)
Sets the color of the search bar background.
|
void |
setDelegate(UISearchBarDelegate delegate)
Sets the delegate object for this search bar,the object responsible for
search bar's functionality.
|
void |
setImage(UIImage iconImage,
int UISearchBarIcon,
int UIControlState)
Sets the image for a given search bar icon type and control state of this
search bar.
|
void |
setKeyboardType(int UIKeyboardType)
Sets the type of keyboard for the text field of the search bar.
|
void |
setPlaceholder(String placeholder)
Sets the appropriate String when there is no text in the text field of
the search bar.
|
void |
setPrompt(String prompt)
Sets as prompt text displayed above the search bar the String specified
in the prompt parameter.
|
void |
setScopeButtonTitles(List<String> scopeButtonTitles)
Sets the titles displayed on the scope buttons.
|
void |
setSearchBarStyle(int UISearchBarStyle)
Set the background style of this search bar.
|
void |
setSelectedScopeButtonIndex(int selectedScopeButtonIndex)
Sets the scope button at the specified index as selected.
|
void |
setShowsBookmarkButton(boolean showsBookmarkButton)
Sets the flag defined by the showsBookmarkButton for existence of
bookmark button.
|
void |
setShowsCancelButton(boolean showsCancelButton)
Sets the flag defined by showCancelButton for existence of cancel button
or not for this search bar.
|
void |
setShowsScopeBar(boolean showsScopeBar)
Sets the scope bar visible or not according to the parameter.
|
void |
setText(String text)
Sets the text field of this search bar the String text.
|
void |
setTranslucent(boolean translucent)
Sets the search bar translucent or not.
|
boolean |
showsBookmarkButton()
Returns a flag that indicates whether there is a bookmark or not on this
search bar.
|
boolean |
showsCancelButton()
Return a flag that defines if there is a cancel button or not.
|
boolean |
showsScopeBar()
Returns the visibility state of the scope bar.
|
String |
text()
Returns the String that is inside the text field of this search bar.
|
accessibilityIdentifier, addConstraint, addConstraints, addGestureRecognizer, addLayoutGuide, addSubview, alpha, animateWithDuration, animateWithDuration, animateWithDuration, areAnimationsEnabled, autoresizesSubviews, autoresizingMask, backgroundColor, bottomAnchor, bounds, bringSubviewToFront, center, centerXAnchor, centerYAnchor, clipsToBounds, constraints, contentCompressionResistancePriorityForAxis, contentHuggingPriorityForAxis, contentMode, convertPointFromView, convertPointToView, convertRectFromView, convertRectToView, didAddSubview, didMoveToSuperview, didMoveToWindow, drawRect, frame, gestureRecognizers, heightAnchor, hitTest, insertSubview, insetsLayoutMarginsFromSafeArea, intrinsicContentSize, invalidateIntrinsicContentSize, isHidden, isMultipleTouchEnabled, isOpaque, isUserInteractionEnabled, layer, layoutIfNeeded, layoutMargins, layoutMarginsDidChange, layoutMarginsGuide, layoutSubviews, leadingAnchor, leftAnchor, maskView, needsUpdateConstraints, nextResponder, overrideUserInterfaceStyle, pointInside, preservesSuperviewLayoutMargins, removeConstraint, removeConstraints, removeFromSuperview, removeGestureRecognizer, removeLayoutGuide, requiresConstraintBasedLayout, restorationIdentifier, rightAnchor, safeAreaInsets, safeAreaLayoutGuide, sendSubviewToBack, setAccessibilityIdentifier, setAlpha, setAnimationBeginsFromCurrentState, setAnimationCurve, setAnimationDelay, setAnimationDuration, setAnimationRepeatAutoreverses, setAnimationRepeatCount, setAnimationsEnabled, setAnimationStartDate, setAutoresizesSubviews, setAutoresizingMask, setBackgroundColor, setBounds, setCenter, setClearsContextBeforeDrawing, setClipsToBounds, setContentCompressionResistancePriority, setContentHuggingPriority, setContentMode, setFrame, setGestureRecognizers, setHidden, setInsetsLayoutMarginsFromSafeArea, setLayoutMargins, setMaskView, setMultipleTouchEnabled, setNeedsDisplay, setNeedsLayout, setNeedsUpdateConstraints, setOpaque, setOverrideUserInterfaceStyle, setPreservesSuperviewLayoutMargins, setRestorationIdentifier, setTag, setTintAdjustmentMode, setTintColor, setTransform, setTranslatesAutoresizingMaskIntoConstraints, setUserInteractionEnabled, sizeThatFits, sizeToFit, subviews, superview, tag, tintAdjustmentMode, tintColor, tintColorDidChange, topAnchor, toString, trailingAnchor, transform, transitionWithView, translatesAutoresizingMaskIntoConstraints, updateConstraints, updateConstraintsIfNeeded, userInterfaceLayoutDirection, viewForFirstBaselineLayout, viewForLastBaselineLayout, widthAnchor, willMoveToSuperview, willMoveToWindow, willRemoveSubview, window
isFirstResponder, touchesBegan, touchesCancelled, touchesEnded, touchesMoved
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKey
public UISearchBar()
public UISearchBar(CGRect rect)
rect
- CGRect that defines dimension and position of UISearchBarpublic int autocapitalizationType()
UITextAutocapitalizationType
public void setAutocapitalizationType(int UITextAutocapitalizationType)
UITextAutocapitalizationType
- Defines type of autocapitalization.UITextAutocapitalizationType
public int autocorrectionType()
UITextAutocorrectionType
public void setAutocorrectionType(int UITextAutocorrectionType)
UITextAutocorrectionType
- Defines the type of autocorrection.UITextAutocorrectionType
public int barStyle()
UIBarStyle
public void setBarStyle(int UIBarStyle)
UIBarStyle
- Defines the type of style.UIBarStyle
public int searchBarStyle()
UISearchBarStyle
public void setSearchBarStyle(int UISearchBarStyle)
UISearchBarStyle
- Defines the background style of this search bar.UISearchBarStyle
public UISearchBarDelegate delegate()
public void setImage(UIImage iconImage, int UISearchBarIcon, int UIControlState)
iconImage
- The image of the search bar.UISearchBarIcon
- The icon type for which the image is set.UIControlState
- The state of the search bar.UISearchBarIcon
,
UIControlState
public void setDelegate(UISearchBarDelegate delegate)
delegate
- Delegate object.public int keyboardType()
public void setKeyboardType(int UIKeyboardType)
UIKeyboardType
- Defines the type of keyboard of the text field.public String placeholder()
public void setPlaceholder(String placeholder)
placeholder
- The String to be displayed into the search bar, when
there is no text.public String prompt()
public void setPrompt(String prompt)
prompt
- The prompt text above the search bar.public boolean showsBookmarkButton()
public void setShowsBookmarkButton(boolean showsBookmarkButton)
showsBookmarkButton
- Defines the existence or not of a bookmark
button of this search bar.public boolean showsCancelButton()
public void setShowsCancelButton(boolean showsCancelButton)
showsCancelButton
- Defines the existence or not of a cancel button.public String text()
public void setText(String text)
text
- String for the text field.public UIColor barTintColor()
public void setBarTintColor(UIColor tintColor)
tintColor
- The color of the search bar background.public boolean isTranslucent()
public void setTranslucent(boolean translucent)
translucent
- TRUE the search bar is translucent.public List<String> scopeButtonTitles()
public void setScopeButtonTitles(List<String> scopeButtonTitles)
scopeButtonTitles
- The list withe the new titles displayed on the
scope buttons.public int selectedScopeButtonIndex()
public void setSelectedScopeButtonIndex(int selectedScopeButtonIndex)
selectedScopeButtonIndex
- The index of the selected scope button.public boolean showsScopeBar()
public void setShowsScopeBar(boolean showsScopeBar)
showsScopeBar
- Boolean that defines visibility of scope bar.public boolean resignFirstResponder()
UIResponder
resignFirstResponder
in class UIResponder
public boolean becomeFirstResponder()
UIResponder
becomeFirstResponder
in class UIResponder
Copyright © 2020. All rights reserved.