1、 android.widget.SpinnerKnown Direct SubclassesAppCompatSpinnerClass OverviewA 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.SummaryXML AttributesAttribute Name Related Method D
2、escriptionandroid:dropDownHorizontalOffset setDropDownHorizontalOffset(int) Amount of pixels by which the drop down should be offset horizontally. dropDownSelector List selector to use for spinnerMode=dropdown display. dropDownVerticalOffset setDropDownVerticalOffset(int) Amount of pixels by which t
3、he drop down should be offset vertically. dropDownWidth setDropDownWidth(int) Width of the dropdown in spinnerMode=. gravity setGravity(int) Gravity setting for positioning the currently selected item. popupBackground setPopupBackgroundResource(int) Background drawable to use for the dropdown in spi
4、nnerMode=prompt The prompt to display when the spinners dialog is shown. spinnerMode Display mode for spinner options. ExpandInherited XML AttributesFrom class android.widget.AbsSpinnerFrom class android.view.ViewGroupFrom class android.view.ViewConstantsint MODE_DIALOG Use a dialog window for selec
5、ting spinner options.int MODE_DROPDOWN Use a dropdown anchored to the Spinner for selecting spinner options.Inherited ConstantsFrom class android.widget.AdapterViewInherited FieldsPublic ConstructorsSpinner(Context context)Construct a new spinner with the given contexts theme.Spinner(Context context
6、, int mode)s theme and the supplied mode of displaying choices.Spinner(Context context, AttributeSet attrs)s theme and the supplied attribute set.Spinner(Context context, AttributeSet attrs, int defStyleAttr)s theme, the supplied attribute set, and default style attribute.Spinner(Context context, At
7、tributeSet attrs, int defStyleAttr, int mode)s theme, the supplied attribute set, and default style.Spinner(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes, int mode)Spinner(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes, int mode, Resources.Theme popup
8、Theme)Constructs a new spinner with the given contexts theme, the supplied attribute set, default styles, popup mode (one of MODE_DIALOG or MODE_DROPDOWN), and the context against which the popup should be inflated.Public MethodsCharSequence getAccessibilityClassName()Return the class name of this o
9、bject to be used for accessibility purposes.int getBaseline()Return the offset of the widgets text baseline from the widgets top boundary.int getDropDownHorizontalOffset()Get the configured horizontal offset in pixels for the spinners popup window of choices.int getDropDownVerticalOffset()Get the co
10、nfigured vertical offset in pixels for the spinnerint getDropDownWidth()Get the configured width of the spinners popup window of choices in pixels.int getGravity()Describes how the selected item view is positioned.Drawable getPopupBackground()Get the background drawable for the spinnerContext getPop
11、upContext()CharSequence getPrompt()void onClick(DialogInterface dialog, int which)This method will be invoked when a button in the dialog is clicked.void onRestoreInstanceState(Parcelable state)Hook allowing a view to re-apply a representation of its internal state that had previously been generated
12、 by onSaveInstanceState().Parcelable onSaveInstanceState()Hook allowing a view to generate a representation of its internal state that can later be used to create a new instance with that same state.boolean onTouchEvent(MotionEvent event)Implement this method to handle touch screen motion events.boo
13、lean performClick()Call this views OnClickListener, if it is defined.void setAdapter(SpinnerAdapter adapter)Sets the SpinnerAdapter used to provide the data which backs this Spinner.void setDropDownHorizontalOffset(int pixels)Set a horizontal offset in pixels for the spinnervoid setDropDownVerticalOffset(int pixels)Set a vertical offset in pixels for the spinnervoid setDropDownW
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1