android之switch控件的用法
来源:互联网 发布:手机淘宝联盟 编辑:程序博客网 时间:2024/05/29 19:45
布局代码:
<Switch
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/sound_switch"/>
java代码:
soundSwt = (Switch)findViewById(R.id.sound_switch);
soundSwt.setChecked(MainActivity.soundSwitch);
soundSwt.setOnCheckedChangeListener(new OnCheckedChangeListener(){
@Override
public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
// TODO Auto-generated method stub
if(arg1){
MainActivity.soundSwitch=true;
} else {
MainActivity.soundSwitch=false;
}
}
});
0 0
- android之switch控件的用法
- android之switch控件的用法
- Android之switch控件的用法
- android之switch控件的用法
- android之switch控件的用法
- android之switch控件的用法
- Android控件之Switch
- Android控件之ToggleButton、Switch
- switch(开关按钮) 控件的用法
- Android UI控件之ToggleButton、Switch
- Android ui 控件之仿苹果SWITCH
- android android.widget.Switch控件的介绍
- android 4.0 switch控件的使用
- 漂亮简单的Android 自定义 Switch 控件!
- Android 4.0新控件 switch的属性
- Android 开关控件Switch的简单使用
- Android之spinner控件的用法
- 【Android控件】之EditText的基本用法
- QuaZip的源码编译和生成DLL后的使用总结
- Android 时间轴的实现
- 服务器遭受攻击的解决办法
- Android事件的分发机制
- 递归函数
- android之switch控件的用法
- Haskell 5
- poj 2377
- javascript基础笔记(一)之js的简介
- Linux SVN 搭建(YUM)安装
- 二分查找
- 用Mathematica 画常微分方程斜率场(积分曲线)
- 【NOIP2011】统计单词个数 划分性dp*2
- js高级第一节