安卓

注册

 

发新话题 回复该主题

安卓开发入门教程UI控件Switch [复制链接]

1#
小孩为什么会得白癜风 https://m-mip.39.net/baidianfeng/mipso_4358975.html
什么是Switch

Switch是一种用于显示开关状态的UI控件.

基础样例1.普通开关效果图代码

Switchandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="我是Switch"/2.设置字号效果图代码

Switchandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="我是20号字体的Switch"android:textSize="20sp"/3.设置颜色效果图代码

Switchandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="我是红色的Switch"android:textColor="#FF"/4.设置加粗效果图代码

Switchandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="我是加粗的Switch"android:textStyle="bold"/5.设置选中效果图代码

Switchandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:checked="true"android:text="我是被选中的Switch"/5.设置开关按钮文字效果图代码

Switchandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:showText="true"android:text="开关上显示文字"android:textOff="已关闭"android:textOn="已打开"/基础样例完整源代码

分享 转发
TOP
发新话题 回复该主题