本文实例讲述了Android使用ToggleButton实现开关效果的方法。分享给大家供大家参考,具体如下:activity_main.xml<?xml version="1.0" encoding="utf-8"?&
本文实例讲述了Android使用ToggleButton实现开关效果的方法。分享给大家供大家参考,具体如下:
activity_main.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="Http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ToggleButton android:checked="false" android:textOn="开" android:textOff="关" android:id="@+id/toggleButton1" android:layout_width="match_parent" android:layout_height="wrap_content" /> <ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/off" /></LinearLayout>
--结束END--
本文标题: Android开发之ToggleButton实现开关效果示例
本文链接: https://www.lsjlt.com/news/221921.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0