java.lang.Object | |||||
↳ | android.view.View | ||||
↳ | android.view.ViewGroup | ||||
↳ | android.widget.AdapterView<T extends android.widget.Adapter> | ||||
↳ | android.widget.AbsSpinner | ||||
↳ | android.widget.Spinner |
A view that displays one child at a time and lets the user pick among them. The items in the Spinner come from the Adapter
associated with this view.
See the Spinners guide.
XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|||||||||
android:dropDownHorizontalOffset | setDropDownHorizontalOffset(int) | Horizontal offset from the spinner widget for positioning the dropdown in spinnerMode="dropdown". | |||||||||
android:dropDownSelector | List selector to use for spinnerMode="dropdown" display. | ||||||||||
android:dropDownVerticalOffset | setDropDownVerticalOffset(int) | Vertical offset from the spinner widget for positioning the dropdown in spinnerMode="dropdown". | |||||||||
android:dropDownWidth | setDropDownWidth(int) | Width of the dropdown in spinnerMode="dropdown". | |||||||||
android:gravity | setGravity(int) | Gravity setting for positioning the currently selected item. | |||||||||
android:popupBackground | setPopupBackgroundResource(int) | Background drawable to use for the dropdown in spinnerMode="dropdown". | |||||||||
android:prompt | The prompt to display when the spinner's dialog is shown. | ||||||||||
android:spinnerMode | Display mode for spinner options. |
[Expand]
Inherited XML Attributes
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class android.widget.AbsSpinner
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From class android.view.ViewGroup
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From class android.view.View
|
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | MODE_DIALOG | Use a dialog window for selecting spinner options. | |||||||||
int | MODE_DROPDOWN | Use a dropdown anchored to the Spinner for selecting spinner options. |
[Expand]
Inherited Constants
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class android.widget.AdapterView
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From class android.view.ViewGroup
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From class android.view.View
|
[Expand]
Inherited Fields
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class android.view.View
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Construct a new spinner with the given context's theme.
|
||||||||||
|
Construct a new spinner with the given context's theme and the supplied mode of displaying choices.
|
||||||||||
|
Construct a new spinner with the given context's theme and the supplied attribute set.
|
||||||||||
|
Construct a new spinner with the given context's theme, the supplied attribute set, and default style.
|
||||||||||
|
Construct a new spinner with the given context's theme, the supplied attribute set, and default style.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Return the offset of the widget's text baseline from the widget's top boundary. |
|||||||||
|
|
Get the configured horizontal offset in pixels for the spinner's popup window of choices.
|
|||||||||
|
|
Get the configured vertical offset in pixels for the spinner's popup window of choices.
|
|||||||||
|
|
Get the configured width of the spinner's popup window of choices in pixels.
|
|||||||||
|
|
Describes how the selected item view is positioned.
|
|||||||||
|
|
Get the background drawable for the spinner's popup window of choices.
|
|||||||||
|
|
|
|||||||||
|
|
This method will be invoked when a button in the dialog is clicked.
|
|||||||||
|
|
Initializes an
AccessibilityEvent with information about this View which is the event source.
|
|||||||||
|
|
Initializes an
AccessibilityNodeInfo with information about this view.
|
|||||||||
|
|
Call this view's OnClickListener, if it is defined.
|
|||||||||
|
|
The Adapter is used to provide the data which backs this Spinner.
|
|||||||||
|
|
Set a horizontal offset in pixels for the spinner's popup window of choices.
|
|||||||||
|
|
Set a vertical offset in pixels for the spinner's popup window of choices.
|
|||||||||
|
|
Set the width of the spinner's popup window of choices in pixels.
|
|||||||||
|
|
Set the enabled state of this view.
|
|||||||||
|
|
Describes how the selected item view is positioned.
|
|||||||||
|
|
A spinner does not support item click events. |
|||||||||
|
|
Set the background drawable for the spinner's popup window of choices.
|
|||||||||
|
|
Set the background drawable for the spinner's popup window of choices.
|
|||||||||
|
|
Sets the prompt to display when the dialog is shown.
|
|||||||||
|
|
Sets the prompt to display when the dialog is shown.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
This is called when the view is detached from a window.
|
||||||||||
|
Called from layout when this view should assign a size and position to each of its children.
|
||||||||||
|
Measure the view and its content to determine the measured width and the measured height. |
[Expand]
Inherited Methods
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class android.widget.AbsSpinner
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From class android.widget.AdapterView
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From class android.view.ViewGroup
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From class android.view.View
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From class java.lang.Object
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From interface android.content.DialogInterface.OnClickListener
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From interface android.graphics.drawable.Drawable.Callback
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From interface android.view.KeyEvent.Callback
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From interface android.view.ViewManager
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From interface android.view.ViewParent
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From interface android.view.accessibility.AccessibilityEventSource
|
Horizontal offset from the spinner widget for positioning the dropdown in spinnerMode="dropdown".
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp
". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters).
This may also be a reference to a resource (in the form "@[package:]type:name
") or theme attribute (in the form "?[package:][type:]name
") containing a value of this type.
This corresponds to the global attribute resource symbol dropDownHorizontalOffset
.
List selector to use for spinnerMode="dropdown" display.
May be a reference to another resource, in the form "@[+][package:]type:name
" or to a theme attribute in the form "?[package:][type:]name
".
May be a color value, in the form of "#rgb
", "#argb
", "#rrggbb
", or "#aarrggbb
".
This corresponds to the global attribute resource symbol dropDownSelector
.
Vertical offset from the spinner widget for positioning the dropdown in spinnerMode="dropdown".
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp
". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters).
This may also be a reference to a resource (in the form "@[package:]type:name
") or theme attribute (in the form "?[package:][type:]name
") containing a value of this type.
This corresponds to the global attribute resource symbol dropDownVerticalOffset
.
Width of the dropdown in spinnerMode="dropdown".
May be a dimension value, which is a floating point number appended with a unit such as "14.5sp
". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters).
This may also be a reference to a resource (in the form "@[package:]type:name
") or theme attribute (in the form "?[package:][type:]name
") containing a value of this type.
May be one of the following constant values.
Constant | Value | Description |
---|---|---|
fill_parent |
-1 | The dropdown should fill the width of the screen. This constant is deprecated starting from API Level 8 and is replaced by match_parent . |
match_parent |
-1 | The dropdown should fit the width of the screen. Introduced in API Level 8. |
wrap_content |
-2 | The dropdown should fit the width of its anchor. |
This corresponds to the global attribute resource symbol dropDownWidth
.
Gravity setting for positioning the currently selected item.
Must be one or more (separated by '|') of the following constant values.
Constant | Value | Description |
---|---|---|
top |
0x30 | Push object to the top of its container, not changing its size. |
bottom |
0x50 | Push object to the bottom of its container, not changing its size. |
left |
0x03 | Push object to the left of its container, not changing its size. |
right |
0x05 | Push object to the right of its container, not changing its size. |
center_vertical |
0x10 | Place object in the vertical center of its container, not changing its size. |
fill_vertical |
0x70 | Grow the vertical size of the object if needed so it completely fills its container. |
center_horizontal |
0x01 | Place object in the horizontal center of its container, not changing its size. |
fill_horizontal |
0x07 | Grow the horizontal size of the object if needed so it completely fills its container. |
center |
0x11 | Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. |
fill |
0x77 | Grow the horizontal and vertical size of the object if needed so it completely fills its container. |
clip_vertical |
0x80 | Additional option that can be set to have the top and/or bottom edges of the child clipped to its container's bounds. The clip will be based on the vertical gravity: a top gravity will clip the bottom edge, a bottom gravity will clip the top edge, and neither will clip both edges. |
clip_horizontal |
0x08 | Additional option that can be set to have the left and/or right edges of the child clipped to its container's bounds. The clip will be based on the horizontal gravity: a left gravity will clip the right edge, a right gravity will clip the left edge, and neither will clip both edges. |
start |
0x00800003 | Push object to the beginning of its container, not changing its size. |
end |
0x00800005 | Push object to the end of its container, not changing its size. |
This corresponds to the global attribute resource symbol gravity
.
Background drawable to use for the dropdown in spinnerMode="dropdown".
May be a reference to another resource, in the form "@[+][package:]type:name
" or to a theme attribute in the form "?[package:][type:]name
".
May be a color value, in the form of "#rgb
", "#argb
", "#rrggbb
", or "#aarrggbb
".
This corresponds to the global attribute resource symbol popupBackground
.
The prompt to display when the spinner's dialog is shown.
Must be a reference to another resource, in the form "@[+][package:]type:name
" or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute resource symbol prompt
.
Display mode for spinner options.
Must be one of the following constant values.
Constant | Value | Description |
---|---|---|
dialog |
0 | Spinner options will be presented to the user as a dialog window. |
dropdown |
1 | Spinner options will be presented to the user as an inline dropdown anchored to the spinner widget itself. |
This corresponds to the global attribute resource symbol spinnerMode
.
Use a dialog window for selecting spinner options.
Use a dropdown anchored to the Spinner for selecting spinner options.
Construct a new spinner with the given context's theme.
context | The Context the view is running in, through which it can access the current theme, resources, etc. |
---|
Construct a new spinner with the given context's theme and the supplied mode of displaying choices. mode
may be one of MODE_DIALOG
or MODE_DROPDOWN
.
context | The Context the view is running in, through which it can access the current theme, resources, etc. |
---|---|
mode | Constant describing how the user will select choices from the spinner. |
Construct a new spinner with the given context's theme and the supplied attribute set.
context | The Context the view is running in, through which it can access the current theme, resources, etc. |
---|---|
attrs | The attributes of the XML tag that is inflating the view. |
Construct a new spinner with the given context's theme, the supplied attribute set, and default style.
context | The Context the view is running in, through which it can access the current theme, resources, etc. |
---|---|
attrs | The attributes of the XML tag that is inflating the view. |
defStyle | The default style to apply to this view. If 0, no style will be applied (beyond what is included in the theme). This may either be an attribute resource, whose value will be retrieved from the current theme, or an explicit style resource. |
Construct a new spinner with the given context's theme, the supplied attribute set, and default style. mode
may be one of MODE_DIALOG
or MODE_DROPDOWN
and determines how the user will select choices from the spinner.
context | The Context the view is running in, through which it can access the current theme, resources, etc. |
---|---|
attrs | The attributes of the XML tag that is inflating the view. |
defStyle | The default style to apply to this view. If 0, no style will be applied (beyond what is included in the theme). This may either be an attribute resource, whose value will be retrieved from the current theme, or an explicit style resource. |
mode | Constant describing how the user will select choices from the spinner. |
Return the offset of the widget's text baseline from the widget's top boundary. If this widget does not support baseline alignment, this method returns -1.
Get the configured horizontal offset in pixels for the spinner's popup window of choices. Only valid in MODE_DROPDOWN
; other modes will return 0.
Get the configured vertical offset in pixels for the spinner's popup window of choices. Only valid in MODE_DROPDOWN
; other modes will return 0.
Get the configured width of the spinner's popup window of choices in pixels. The returned value may also be MATCH_PARENT
meaning the popup window will match the width of the Spinner itself, or WRAP_CONTENT
to wrap to the measured size of contained dropdown list items.
Describes how the selected item view is positioned. The default is determined by the current theme.
Gravity
value Get the background drawable for the spinner's popup window of choices. Only valid in MODE_DROPDOWN
; other modes will return null.
This method will be invoked when a button in the dialog is clicked.
dialog | The dialog that received the click. |
---|---|
which | The button that was clicked (e.g. BUTTON1 ) or the position of the item clicked. |
Initializes an AccessibilityEvent
with information about this View which is the event source. In other words, the source of an accessibility event is the view whose state change triggered firing the event.
Example: Setting the password property of an event in addition to properties set by the super implementation:
public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); event.setPassword(true); }
If an View.AccessibilityDelegate
has been specified via calling setAccessibilityDelegate(AccessibilityDelegate)
its onInitializeAccessibilityEvent(View, AccessibilityEvent)
is responsible for handling this call.
Note: Always call the super implementation before adding information to the event, in case the default implementation has basic information to add.
event | The event to initialize. |
---|
Initializes an AccessibilityNodeInfo
with information about this view. The base implementation sets:
setParent(View)
,setBoundsInParent(Rect)
,setBoundsInScreen(Rect)
,setPackageName(CharSequence)
,setClassName(CharSequence)
,setContentDescription(CharSequence)
,setEnabled(boolean)
,setClickable(boolean)
,setFocusable(boolean)
,setFocused(boolean)
,setLongClickable(boolean)
,setSelected(boolean)
,Subclasses should override this method, call the super implementation, and set additional attributes.
If an View.AccessibilityDelegate
has been specified via calling setAccessibilityDelegate(AccessibilityDelegate)
its onInitializeAccessibilityNodeInfo(View, AccessibilityNodeInfo)
is responsible for handling this call.
info | The instance to initialize. |
---|
Call this view's OnClickListener, if it is defined. Performs all normal actions associated with clicking: reporting accessibility event, playing a sound, etc.
The Adapter is used to provide the data which backs this Spinner. It also provides methods to transform spinner items based on their position relative to the selected item.
adapter | The SpinnerAdapter to use for this Spinner |
---|
Set a horizontal offset in pixels for the spinner's popup window of choices. Only valid in MODE_DROPDOWN
; this method is a no-op in other modes.
pixels | Horizontal offset in pixels |
---|
Set a vertical offset in pixels for the spinner's popup window of choices. Only valid in MODE_DROPDOWN
; this method is a no-op in other modes.
pixels | Vertical offset in pixels |
---|
Set the width of the spinner's popup window of choices in pixels. This value may also be set to MATCH_PARENT
to match the width of the Spinner itself, or WRAP_CONTENT
to wrap to the measured size of contained dropdown list items.
Only valid in MODE_DROPDOWN
; this method is a no-op in other modes.
pixels | Width in pixels, WRAP_CONTENT, or MATCH_PARENT |
---|
Set the enabled state of this view. The interpretation of the enabled state varies by subclass.
enabled | True if this view is enabled, false otherwise. |
---|
Describes how the selected item view is positioned. Currently only the horizontal component is used. The default is determined by the current theme.
gravity | See Gravity |
---|
A spinner does not support item click events. Calling this method will raise an exception.
Instead use setOnItemSelectedListener(AdapterView.OnItemSelectedListener)
.
l | this listener will be ignored |
---|
Set the background drawable for the spinner's popup window of choices. Only valid in MODE_DROPDOWN
; this method is a no-op in other modes.
background | Background drawable |
---|
Set the background drawable for the spinner's popup window of choices. Only valid in MODE_DROPDOWN
; this method is a no-op in other modes.
resId | Resource ID of a background drawable |
---|
Sets the prompt to display when the dialog is shown.
prompt | the prompt to set |
---|
Sets the prompt to display when the dialog is shown.
promptId | the resource ID of the prompt to display when the dialog is shown |
---|
This is called when the view is detached from a window. At this point it no longer has a surface for drawing.
Called from layout when this view should assign a size and position to each of its children. Derived classes with children should override this method and call layout on each of their children.
changed | This is a new size or position for this view |
---|---|
l | Left position, relative to parent |
t | Top position, relative to parent |
r | Right position, relative to parent |
b | Bottom position, relative to parent |
Measure the view and its content to determine the measured width and the measured height. This method is invoked by measure(int, int)
and should be overriden by subclasses to provide accurate and efficient measurement of their contents.
CONTRACT: When overriding this method, you must call setMeasuredDimension(int, int)
to store the measured width and height of this view. Failure to do so will trigger an IllegalStateException
, thrown by measure(int, int)
. Calling the superclass' onMeasure(int, int)
is a valid use.
The base class implementation of measure defaults to the background size, unless a larger size is allowed by the MeasureSpec. Subclasses should override onMeasure(int, int)
to provide better measurements of their content.
If this method is overridden, it is the subclass's responsibility to make sure the measured height and width are at least the view's minimum height and width (getSuggestedMinimumHeight()
and getSuggestedMinimumWidth()
).
widthMeasureSpec | horizontal space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec . |
---|---|
heightMeasureSpec | vertical space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec . |