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:
- Allows dynamic tint of its background via the background tint methods in
CompoundButtonCompat
. - Allows setting of the background tint using
buttonTint
andbuttonTintMode
. - Setting the popup theme using
popupTheme
.
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 |
---|
![]()
android.widget.Spinner
|
![]()
android.widget.AdapterView
|
![]()
android.view.ViewGroup
|
![]()
android.view.View
|
Inherited fields |
---|
![]()
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 |
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 | |
---|---|
![]()
android.widget.Spinner
|