Class Info |
|---|
public class HwToggleButton extends ToggleButton 该类是华为风格的双状态按钮,继承了ToggleButton。 |
Style Name | Style Description |
|---|---|
Widget.Emui.HwToggle | HwToggleButton默认风格(同浅色风格)。 |
Widget.Emui.HwToggle.Light | HwToggleButton浅色风格。 |
Constructor Name |
|---|
public HwToggleButton(Context context) 通过代码实例化HwToggleButton对象。 |
public HwToggleButton(Context context, AttributeSet attrs) 通过XML实例化HwToggleButton对象。 |
public HwToggleButton(Context context, AttributeSet attrs, int defStyleAttr) 通过XML实例化HwToggleButton对象,并应用主题中定义的样式。 |
Qualifier and Type | Method Name and Description |
|---|---|
static HwToggleButton | instantiate(Context context) 静态方法,实例化一个HwToggleButton对象。 |
Constructor |
|---|
public HwToggleButton(Context context) 通过代码实例化HwToggleButton对象。 |
Parameters
Name | Description |
|---|---|
context | 控件的上下文。 |
Constructor |
|---|
public HwToggleButton(Context context, AttributeSet attrs) 通过XML实例化HwToggleButton对象。 |
Parameters
Name | Description |
|---|---|
context | 控件的上下文。 |
attrs | XML中配置的控件属性集合。 |
Constructor |
|---|
public HwToggleButton(Context context, AttributeSet attrs, int defStyleAttr) 通过XML实例化HwToggleButton对象,并应用主题中定义的样式。 |
Parameters
Name | Description |
|---|---|
context | 控件的上下文。 |
attrs | XML中配置的控件属性集合。 |
defStyleAttr | 当前主题中配置的控件默认样式,为0表示不应用默认样式。 |