Android的ToggleButton和Switch以及AnalogColok和DigitalColok的用法-android学习之旅(二十)
2015-05-26 18:23
447 查看
ToggleButton 和Switch简介
ToggleButton 和Switch都是继承了Button,所以他们的属性设置和Button差不多。分别支持的属性
ToggleButton 的属性:Switch的属性:
analogColok和DigitalColok简介
digitalColok继承了text,但是它的setText方法不能使用,能够显示精确到秒,作为数字的表,analogColok则是继承了View,进行了几何的重绘,不能显示秒。analogColok和DigitalColok属性设置
analogColok的属性设置:analogColok和DigitalColok的实例
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity" android:orientation="vertical"> <AnalogClock android:layout_width="wrap_content" android:layout_height="wrap_content" /> <DigitalClock android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="14pt" android:textColor="#f0f" android:drawableRight="@drawable/ic_launcher"/> <AnalogClock android:layout_width="wrap_content" android:layout_height="wrap_content" android:dial="@drawable/ic_launcher"/> </LinearLayout>
效果图
相关文章推荐
- Android的ToggleButton和Switch以及AnalogColok和DigitalColok的用法-android学习之旅(二十)
- Android的ToggleButton和Switch以及AnalogColok和DigitalColok的用法-android学习之旅(二十)
- android基本控件学习-----ToggleButton&Switch
- Android学习路之开关按钮ToggleButton和开关Switch
- Android中ToggleButton,Switch,SeekBar,RatingBar的一些用法
- 开关按钮(ToggleButton)与开关(Switch)的功能与用法
- Android ToggleButton,Switch控件完整案例
- Android控件之ProgressBar(进度条),ToggleButton/SwitchBar(开关按钮),SeekBar(拖动条)/RatingBar(等级评分)
- AndroidUI:ToggleButton + Switch + CheckBox + CheckedTextView
- Android入门教程二十八之开关按钮ToggleButton和开关Switch
- Android零基础入门第21节:ToggleButton和Switch使用大全
- Android零基础入门第21节:ToggleButton和Switch使用大全
- Android零基础入门第21节:ToggleButton和Switch使用大全
- Android零基础入门第21节:ToggleButton和Switch使用大全
- Android控制之ToggleButton和Switch与RatingBar
- Android开发学习笔记:浅谈ToggleButton
- 第38章、开关控件Switch和ToggleButton(从零开始学Android)
- Android学习之Service命令的使用以及am的用法
- Android UI控件之ToggleButton、Switch
- Android UI控件之ToggleButton、Switch