Android:Material Design之 Switch
来源:互联网 发布:查看数据库表内容 编辑:程序博客网 时间:2024/05/16 13:58
开关
On/off 开关切换单一设置选择的状态。开关控制的选项以及它的状态,应该明确的展示出来并且与内部的标签相一致。开关应该单选按钮呈现相同的视觉特性。
开关通过动画来传达被聚焦和被按下的状态。
开关滑块上标明 “on” 和 “off” 的做法被弃用,取而代之的是下图所示的开关。
<android.support.v7.widget.SwitchCompat android:id="@+id/sc_settin_testxinlv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginBottom="10dp" android:layout_marginRight="20dp" android:layout_marginTop="10dp" />
public class SetActivity extends AppCompatActivity implements View.OnClickListener, CompoundButton.OnCheckedChangeListener { SwitchCompat switchCompat; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_setting); switchCompat = (SwitchCompat) findViewById(R.id .sc_settin_testxinlv); switchCompat.setSwitchPadding(40); switchCompat.setOnCheckedChangeListener(this); } @Override protected void onStop() { super.onStop(); } @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { switch (compoundButton.getId()) { case R.id.sc_settin_testxinlv: break; } }}
http://blog.csdn.net/ddwhan0123/article/details/50592579
http://www.truiton.com/2015/03/android-switch-button-example/
0 0
- Android:Material Design之 Switch
- Material Design控件之Switch|SwitchCompat
- Android Material Design 之 Material Theme
- Android Material Design 之 基础知识
- Android Material Design 之 图形
- android material design之snackbar
- Android Material Design之BottomSheetDialog
- Android Material Design之TextInputLayout
- Android Material Design之Snackbar
- Android Material Design之FloatingActionButton
- Android Material Design之CoordinatorLayout
- Android Material Design之TextInputLayout
- 基础Android之Material Design
- Android Material Design之CoordinatorLayout
- Android Material Design 之 Snackbar
- Android Material Design 之 TextInputLayout
- Android Material Design 之 TabLayout
- Android Material Design 之 Toolbar
- [s3c2416x移植u-boot-2015.10] 让u-boot-2015.10支持spl nand的启动
- session 共享(同一个域下)
- 使用dom4j和jdom解析与生成字符串型XML的代码示例
- Android之Gallery的两种使用方法
- redis练习手册<二>快速入门
- Android:Material Design之 Switch
- [转载]Java中的static关键字解析
- 在Unity游戏开发中使用暂停的小技巧
- Swift泛型
- SQL Server中的sysobjects
- 网络流
- LA3882
- C++——STL所有算法介绍 http://blog.csdn.net/shinehoo/article/details/5736155
- 二进制