詳解Android 手機衛(wèi)士設(shè)置向?qū)ы撁?/h1>
更新時間:2016年04月11日 11:05:35 作者:陶士涵
這篇文章主要介紹了詳解Android 手機衛(wèi)士設(shè)置向?qū)ы撁娴南嚓P(guān)資料,需要的朋友可以參考下
推薦閱讀:
淺析Android手機衛(wèi)士關(guān)閉自動更新
設(shè)置向?qū)ы撁?,通過SharedPreferences來判斷是否已經(jīng)設(shè)置過了,跳轉(zhuǎn)到不同的頁面
自定義樣式
在res/values/styles.xml中
添加節(jié)點<style name=””>,設(shè)置名稱屬性
在<style>節(jié)點里面,添加節(jié)點<item name=””>設(shè)置名稱屬性,就是布局的各種參數(shù)
在<item>的文本里面,設(shè)置布局的各種參數(shù)值
在布局文件中引用樣式,style=”@style/xxxxxxxxxxxx”
在TextView的左側(cè)放置小圖標
使用左側(cè)圖標屬性android:drawableLeft=”@android:drawable/xxxxxxxxxxx”,引用android系統(tǒng)的圖標,例如:@android:drawable/star_big_on
圖標垂直居中對齊,使用對齊屬性 android:gravity=”center_vertical”
引導頁下面的小圓點
線性布局,橫向,ImageView,包裹內(nèi)容,整體居中
使用系統(tǒng)圖標 @android:drawable/presence_online
@android:drawable/presence_invisible
自定義按鈕狀態(tài)背景
在res/drawable/button.xml文件中定義,添加節(jié)點<selector>
定義按鈕按下狀態(tài) 添加<item>節(jié)點,設(shè)置狀態(tài)屬性android:state_pressed=”true”
設(shè)置圖片屬性android:drawable=”xxxx”
設(shè)置按鈕焦點狀態(tài) 添加<item>節(jié)點,設(shè)置狀態(tài)屬性android:state_focus=”true”
定義按鈕默認圖片 添加<item>節(jié)點,設(shè)置圖片屬性android:drawable=”xxxx”
設(shè)置圖片屬性android:drawable=”xxxx”
布局文件中,給按鈕設(shè)置背景,android:background=”@drawable/xxxxx”
activity_lost_find.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#2D89EF"
android:gravity="center"
android:text="1.手機防盜設(shè)置向?qū)?
android:textColor="#fff"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="8dp"
android:text="手機防盜包含以下功能:"
android:textSize="16sp" />
<TextView
style="@style/guide_text_list"
android:drawableLeft="@android:drawable/btn_star_big_on"
android:text="SIM卡變更報警" />
<TextView
style="@style/guide_text_list"
android:drawableLeft="@android:drawable/btn_star_big_on"
android:text="GPS追蹤" />
<TextView
style="@style/guide_text_list"
android:drawableLeft="@android:drawable/btn_star_big_on"
android:text="遠程數(shù)據(jù)銷毀" />
<TextView
style="@style/guide_text_list"
android:drawableLeft="@android:drawable/btn_star_big_on"
android:text="遠程鎖屏" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/presence_online" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/presence_invisible" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/presence_invisible" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/presence_invisible" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:textColor="#444"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/button_selector"
android:text="下一步" />
</RelativeLayout>
</LinearLayout>
button_selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/barcode_btn_guide_pressed" android:state_focused="true"></item>
<item android:drawable="@drawable/barcode_btn_guide_pressed" android:state_pressed="true"></item>
<item android:drawable="@drawable/barcode_btn_guide_normal"></item>
</selector>
相關(guān)文章
-
Android使用listview實現(xiàn)分頁刷新(線程休眠模擬)
這篇文章主要為大家詳細介紹了Android使用listview實現(xiàn)分頁刷新,具有一定的參考價值,感興趣的小伙伴們可以參考一下 2016-11-11
-
Android開發(fā)之設(shè)置開機自動啟動的幾種方法
這篇文章主要介紹了Android開發(fā)之設(shè)置開機自動啟動的幾種方法的相關(guān)資料,這里提供三種方法幫助大家實現(xiàn)這樣的功能,需要的朋友可以參考下 2017-08-08
-
Android中MPAndroidChart自定義繪制最高點標識的方法
目前在做一款軟件,要求在展示走勢圖的時候?qū)ψ罡唿c進行自定義繪制,下面這篇文章主要給大家介紹了關(guān)于Android中MPAndroidChart自定義繪制最高點標識的方法,文中通過示例代碼介紹的非常詳細,需要的朋友可以參考借鑒,下面隨著小編來一起學習學習吧。 2018-03-03
-
android編程實現(xiàn)局部界面動態(tài)切換的方法
這篇文章主要介紹了android編程實現(xiàn)局部界面動態(tài)切換的方法,以實例形式較為詳細的分析了Android局部切換的布局及功能實現(xiàn)技巧,具有一定參考借鑒價值,需要的朋友可以參考下 2015-11-11
-
android studio 的下拉菜單Spinner使用詳解
這篇文章主要介紹了android studio 的下拉菜單Spinner使用詳解,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧 2019-12-12
-
Crashlytics Android 異常報告統(tǒng)計管理(詳解)
下面小編就為大家?guī)硪黄狢rashlytics Android 異常報告統(tǒng)計管理(詳解)。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧 2017-05-05
最新評論
推薦閱讀:
淺析Android手機衛(wèi)士關(guān)閉自動更新
設(shè)置向?qū)ы撁?,通過SharedPreferences來判斷是否已經(jīng)設(shè)置過了,跳轉(zhuǎn)到不同的頁面
自定義樣式
在res/values/styles.xml中
添加節(jié)點<style name=””>,設(shè)置名稱屬性
在<style>節(jié)點里面,添加節(jié)點<item name=””>設(shè)置名稱屬性,就是布局的各種參數(shù)
在<item>的文本里面,設(shè)置布局的各種參數(shù)值
在布局文件中引用樣式,style=”@style/xxxxxxxxxxxx”
在TextView的左側(cè)放置小圖標
使用左側(cè)圖標屬性android:drawableLeft=”@android:drawable/xxxxxxxxxxx”,引用android系統(tǒng)的圖標,例如:@android:drawable/star_big_on
圖標垂直居中對齊,使用對齊屬性 android:gravity=”center_vertical”
引導頁下面的小圓點
線性布局,橫向,ImageView,包裹內(nèi)容,整體居中
使用系統(tǒng)圖標 @android:drawable/presence_online
@android:drawable/presence_invisible
自定義按鈕狀態(tài)背景
在res/drawable/button.xml文件中定義,添加節(jié)點<selector>
定義按鈕按下狀態(tài) 添加<item>節(jié)點,設(shè)置狀態(tài)屬性android:state_pressed=”true”
設(shè)置圖片屬性android:drawable=”xxxx”
設(shè)置按鈕焦點狀態(tài) 添加<item>節(jié)點,設(shè)置狀態(tài)屬性android:state_focus=”true”
定義按鈕默認圖片 添加<item>節(jié)點,設(shè)置圖片屬性android:drawable=”xxxx”
設(shè)置圖片屬性android:drawable=”xxxx”
布局文件中,給按鈕設(shè)置背景,android:background=”@drawable/xxxxx”
activity_lost_find.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TextView android:layout_width="match_parent" android:layout_height="40dp" android:background="#2D89EF" android:gravity="center" android:text="1.手機防盜設(shè)置向?qū)? android:textColor="#fff" android:textSize="18sp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_marginTop="8dp" android:text="手機防盜包含以下功能:" android:textSize="16sp" /> <TextView style="@style/guide_text_list" android:drawableLeft="@android:drawable/btn_star_big_on" android:text="SIM卡變更報警" /> <TextView style="@style/guide_text_list" android:drawableLeft="@android:drawable/btn_star_big_on" android:text="GPS追蹤" /> <TextView style="@style/guide_text_list" android:drawableLeft="@android:drawable/btn_star_big_on" android:text="遠程數(shù)據(jù)銷毀" /> <TextView style="@style/guide_text_list" android:drawableLeft="@android:drawable/btn_star_big_on" android:text="遠程鎖屏" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:orientation="horizontal" > <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/presence_online" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/presence_invisible" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/presence_invisible" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/presence_invisible" /> </LinearLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" > <Button android:textColor="#444" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_marginBottom="10dp" android:layout_marginRight="10dp" android:background="@drawable/button_selector" android:text="下一步" /> </RelativeLayout> </LinearLayout>
button_selector.xml
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/barcode_btn_guide_pressed" android:state_focused="true"></item> <item android:drawable="@drawable/barcode_btn_guide_pressed" android:state_pressed="true"></item> <item android:drawable="@drawable/barcode_btn_guide_normal"></item> </selector>
相關(guān)文章
Android使用listview實現(xiàn)分頁刷新(線程休眠模擬)
這篇文章主要為大家詳細介紹了Android使用listview實現(xiàn)分頁刷新,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-11-11Android開發(fā)之設(shè)置開機自動啟動的幾種方法
這篇文章主要介紹了Android開發(fā)之設(shè)置開機自動啟動的幾種方法的相關(guān)資料,這里提供三種方法幫助大家實現(xiàn)這樣的功能,需要的朋友可以參考下2017-08-08Android中MPAndroidChart自定義繪制最高點標識的方法
目前在做一款軟件,要求在展示走勢圖的時候?qū)ψ罡唿c進行自定義繪制,下面這篇文章主要給大家介紹了關(guān)于Android中MPAndroidChart自定義繪制最高點標識的方法,文中通過示例代碼介紹的非常詳細,需要的朋友可以參考借鑒,下面隨著小編來一起學習學習吧。2018-03-03android編程實現(xiàn)局部界面動態(tài)切換的方法
這篇文章主要介紹了android編程實現(xiàn)局部界面動態(tài)切換的方法,以實例形式較為詳細的分析了Android局部切換的布局及功能實現(xiàn)技巧,具有一定參考借鑒價值,需要的朋友可以參考下2015-11-11android studio 的下拉菜單Spinner使用詳解
這篇文章主要介紹了android studio 的下拉菜單Spinner使用詳解,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2019-12-12Crashlytics Android 異常報告統(tǒng)計管理(詳解)
下面小編就為大家?guī)硪黄狢rashlytics Android 異常報告統(tǒng)計管理(詳解)。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-05-05