双状态按钮(Toggle)

xml文件代码

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent"
 5     android:orientation="vertical" >
 6     <ImageView android:layout_width="wrap_content"
 7         android:layout_height="wrap_content"
 8         android:src="@drawable/bulb_off"
 9         android:id="@+id/imageView"
10         android:layout_gravity="center_horizontal"
11         />
12     <ToggleButton android:layout_width="140dip"
13         android:layout_height="wrap_content"
14         android:textOn="打开"
15         android:textOff="关闭"
16         android:id="@+id/toggleButton"
17         android:layout_gravity="center_horizontal"
18         />
19 
20 </LinearLayout>
xml文件

相关文章:

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