Most visited

Recently visited

AppCompatRadioButton

public class AppCompatRadioButton
extends RadioButton implements TintableCompoundButton

java.lang.Object
   ↳ android.view.View
     ↳ android.widget.TextView
       ↳ android.widget.Button
         ↳ android.widget.CompoundButton
           ↳ android.widget.RadioButton
             ↳ android.support.v7.widget.AppCompatRadioButton


支持旧版本平台兼容功能的 RadioButton ,包括:

当您在布局中使用RadioButton时,这将自动使用。 编写自定义视图时,您只需手动使用此类。

Summary

Inherited XML attributes

From class android.widget.CompoundButton
From class android.widget.TextView
From class android.view.View

Inherited constants

From class android.view.View

Inherited fields

From class android.view.View

Public constructors

AppCompatRadioButton(Context context)
AppCompatRadioButton(Context context, AttributeSet attrs)
AppCompatRadioButton(Context context, AttributeSet attrs, int defStyleAttr)

Public methods

int getCompoundPaddingLeft()

返回视图的左边距,如果有的话,加左边的Drawable空间。

void setButtonDrawable(int resId)

设置一个可绘制的复合按钮图像作为其资源标识符。

void setButtonDrawable(Drawable buttonDrawable)

将可绘制设置为复合按钮图像。

Inherited methods

From class android.widget.RadioButton
From class android.widget.CompoundButton
From class android.widget.Button
From class android.widget.TextView
From class android.view.View
From class java.lang.Object
From interface android.widget.Checkable
From interface android.view.ViewTreeObserver.OnPreDrawListener
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource
From interface android.support.v4.widget.TintableCompoundButton

Public constructors

AppCompatRadioButton

AppCompatRadioButton (Context context)

Parameters
context Context

AppCompatRadioButton

AppCompatRadioButton (Context context, 
                AttributeSet attrs)

Parameters
context Context
attrs AttributeSet

AppCompatRadioButton

AppCompatRadioButton (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context
attrs AttributeSet
defStyleAttr int

Public methods

getCompoundPaddingLeft

int getCompoundPaddingLeft ()

返回视图的左边距,如果有的话,加左边的Drawable空间。

Returns
int

setButtonDrawable

void setButtonDrawable (int resId)

设置一个可绘制的复合按钮图像作为其资源标识符。

Parameters
resId int: the resource identifier of the drawable

setButtonDrawable

void setButtonDrawable (Drawable buttonDrawable)

将可绘制设置为复合按钮图像。

Parameters
buttonDrawable Drawable: the drawable to set

Hooray!