Stay organized with collections Save and categorize content based on your preferences.
added in version 25.1.0
belongs to Maven artifact com.android.support:appcompat-v7:28.0.0-alpha1

AppCompatSpinner

public class AppCompatSpinner
extends Spinner implements TintableBackgroundView

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.AdapterView<android.widget.SpinnerAdapter>
         ↳ android.widget.AbsSpinner
           ↳ android.widget.Spinner
             ↳ android.support.v7.widget.AppCompatSpinner


A Spinner which supports compatible features on older versions of the platform, including:

This will automatically be used when you use Spinner in your layouts. You should only need to manually use this class when writing custom views.

Summary

Inherited constants

From class android.widget.Spinner
From class android.widget.AdapterView
From class android.view.ViewGroup
From class android.view.View

Inherited fields

From class android.view.View

Public constructors

AppCompatSpinner(Context context)

Construct a new spinner with the given context's theme.

AppCompatSpinner(Context context, int mode)

Construct a new spinner with the given context's theme and the supplied mode of displaying choices.

AppCompatSpinner(Context context, AttributeSet attrs)

Construct a new spinner with the given context's theme and the supplied attribute set.

AppCompatSpinner(Context context, AttributeSet attrs, int defStyleAttr)

Construct a new spinner with the given context's theme, the supplied attribute set, and default style attribute.

AppCompatSpinner(Context context, AttributeSet attrs, int defStyleAttr, int mode)

Construct a new spinner with the given context's theme, the supplied attribute set, and default style.

AppCompatSpinner(Context context, AttributeSet attrs, int defStyleAttr, int mode, Resources.Theme popupTheme)

Constructs a new spinner with the given context's 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 methods

int getDropDownHorizontalOffset()

Get the configured horizontal offset in pixels for the spinner's popup window of choices.

int getDropDownVerticalOffset()
int getDropDownWidth()
Drawable getPopupBackground()
Context getPopupContext()
CharSequence getPrompt()
boolean onTouchEvent(MotionEvent event)
boolean performClick()
void setAdapter(SpinnerAdapter adapter)
void setBackgroundDrawable(Drawable background)
void setBackgroundResource(int resId)
void setDropDownHorizontalOffset(int pixels)
void setDropDownVerticalOffset(int pixels)
void setDropDownWidth(int pixels)
void setPopupBackgroundDrawable(Drawable background)
void setPopupBackgroundResource(int resId)
void setPrompt(CharSequence prompt)

Protected methods

void drawableStateChanged()
void onDetachedFromWindow()
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)

Inherited methods

From class android.widget.Spinner
From class android.widget.AbsSpinner
From class android.widget.AdapterView
From class android.view.ViewGroup
From class android.view.View