Android控件之ToggleButton 

1 ToggleButton简介
ToggleButton用于开关按钮。

 

2 ToggleButton示例
创建一个activity,包含2个ToggleButton。
第一个ToggleButton,采用系统默认的图片;选中时,显示“Sel”,未选中时,显示“Un-sel”。
第二个ToggleButton,采用自定义图片。总共有4种状态:选中状态,选中按下状态,未选中状态,未选中按下状态。
应用层代码

layout文件

manifest文件

点击下载:源代码

运行效果:如图

Android控件之ToggleButton

相关文章:

  • 2021-11-20
  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
  • 2021-09-21
猜你喜欢
  • 2021-08-08
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2021-11-13
  • 2022-12-23
相关资源
相似解决方案