Android 为CheckBoxPreference Preference 控件添加样式
来源:互联网 发布:fluent16.0软件下载 编辑:程序博客网 时间:2024/06/06 21:39
<CheckBoxPreference android:key="enable_adb" android:layout="@layout/static_background" android:widgetLayout="@layout/accelerometer_checkbox" android:title="@string/enable_adb" android:summary="@string/enable_adb_summary"/> <PreferenceCategory android:key="location_category" android:layout="@layout/category_null" android:title="@null" > </PreferenceCategory> <Preference android:key="verifier_device_identifier" android:layout="@layout/static_background" android:widgetLayout="@layout/pref_widget_more" style="?android:attr/preferenceInformationStyle" android:title="@string/verifier_device_identifier" android:summary="@string/verifier_device_identifier_not_available" android:persistent="false" /> <PreferenceCategory android:key="location_category" android:layout="@layout/category_null" android:title="@null" > </PreferenceCategory> <CheckBoxPreference android:key="keep_screen_on" android:layout="@layout/schpwr_background_double_top" android:widgetLayout="@layout/accelerometer_checkbox" android:title="@string/keep_screen_on" android:summary="@string/keep_screen_on_summary"/> <CheckBoxPreference android:key="allow_mock_location" android:layout="@layout/schpwr_background_double_bottom" android:widgetLayout="@layout/accelerometer_checkbox" android:title="@string/allow_mock_location" android:summary="@string/allow_mock_location_summary"/> <PreferenceCategory android:key="location_category" android:layout="@layout/category_null" android:title="@null" > </PreferenceCategory> <ListPreference android:layout="@layout/schpwr_background_double_top" android:widgetLayout="@layout/pref_widget_more" android:key="hdcp_checking" android:title="@string/hdcp_checking_title" android:dialogTitle="@string/hdcp_checking_dialog_title" android:entries="@array/hdcp_checking_titles" android:entryValues="@array/hdcp_checking_values" /> <PreferenceScreen android:key="local_backup_password" android:layout="@layout/schpwr_background_double_bottom" android:widgetLayout="@layout/pref_widget_more" android:title="@string/local_backup_password_title" android:summary="@string/local_backup_password_summary_none" android:persistent="false" > <intent android:action="android.settings.privacy.SET_FULL_BACKUP_PASSWORD" android:targetPackage="com.android.settings" android:targetClass="com.android.settings.SetFullBackupPassword" /> </PreferenceScreen> <PreferenceCategory android:key="debug_ui_category" android:layout="@layout/category_normal" android:title="@string/debug_ui_category"> <CheckBoxPreference android:key="strict_mode" android:layout="@layout/schpwr_background_double_top" android:widgetLayout="@layout/accelerometer_checkbox" android:title="@string/strict_mode" android:summary="@string/strict_mode_summary"/>
R/layout/static_background.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/roundcornerfull" android:gravity="center_vertical" android:orientation="horizontal" android:maxHeight="40dp"> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="6.0dip" android:layout_marginLeft="15.0dip" android:layout_marginRight="6.0dip" android:layout_marginTop="6.0dip" android:layout_weight="1.0" ><LinearLayoutandroid:orientation="vertical"android:layout_width="wrap_content"android:layout_height="wrap_content"><TextView android:id="@android:id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="marquee" android:fadingEdge="horizontal" android:singleLine="true" android:textColor="#ff000000" android:textSize="18.0sp" /><TextView android:id="@android:id/summary" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="marquee" android:fadingEdge="horizontal" android:singleLine="true" android:textColor="#ff000000" android:textSize="12.0sp" /></LinearLayout> </RelativeLayout> <LinearLayout android:id="@android:id/widget_frame" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" android:orientation="vertical" /></LinearLayout>R/layout/accelerometer_checkbox.xml
<CheckBox xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/checkbox" android:layout_width="80dp" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginRight="4.0dip" android:button="@drawable/schpwr_alarm_clock_background" android:clickable="false" android:focusable="false"/>
R/drawable/schpwr_alarm_clock_background.xml
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:state_checked="true" android:drawable="@drawable/auto_on_blue"/><item android:state_checked="false" android:drawable="@drawable/auto_off"/><item android:drawable="@drawable/auto_off"/></selector>
R/layout/pref_widget_more.xml
<?xml version="1.0" encoding="UTF-8"?><ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_marginRight="22.0dip" android:layout_gravity="center_vertical" android:src="@drawable/arrow_select" />
R/drawable/arrow_select.xml
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:drawable="@drawable/listarrowblue" /> <item android:state_pressed="true" android:drawable="@drawable/listarrowblue" /> <item android:drawable="@drawable/listarrow" /></selector>
其他以此类推
- Android 为CheckBoxPreference Preference 控件添加样式
- Android 为CheckBoxPreference Preference 控件添加样式
- Android 为CheckBoxPreference Preference 控件添加样式
- android添加控件selector样式
- Android preference 自定义控件
- Android中preference 自定义样式
- android Preference相关样式修改
- android为RadioButton动态添加style样式
- 为android系统控件设置样式
- Android自定义控件——自定义Preference
- 为select添加样式
- 为<hr>添加样式
- Android为自定义控件添加事件
- 为 android的系统控件添加属性
- Android为控件之间添加分割线
- 为android自定义控件添加自定义属性
- Android为自定义控件添加事件
- Android编程心得-为TextView添加各种样式
- 240多个jQuery_UI插件
- Ural 1019 A Line painting(线段树,成段更新离散化)
- SQL中的时间相加减
- android 设置Button或者ImageButton的背景透明 半透明 透明
- 【讲座笔记】微软人谈IT职业发展
- Android 为CheckBoxPreference Preference 控件添加样式
- js openWin详解 滚动条
- JAVA 用freemaker(xml)生成word下载
- 黑马程序员—学习笔记C#基础3。。
- 《C++ Primer 中文版》211頁習題7.16 “編寫程序使之可以接受本節介紹的命令行選項,并輸出傳遞給main的實參的值”
- JMS 使用步骤
- android Bitmap用法总结
- 关于多态
- 腾讯iweibo修改