[android] 手机卫士设置向导页面
設(shè)置向?qū)ы?yè)面,通過(guò)SharedPreferences來(lái)判斷是否已經(jīng)設(shè)置過(guò)了,跳轉(zhuǎn)到不同的頁(yè)面
?
自定義樣式
在res/values/styles.xml中
添加節(jié)點(diǎn)<style name=””>,設(shè)置名稱(chēng)屬性
在<style>節(jié)點(diǎn)里面,添加節(jié)點(diǎn)<item name=””>設(shè)置名稱(chēng)屬性,就是布局的各種參數(shù)
在<item>的文本里面,設(shè)置布局的各種參數(shù)值
在布局文件中引用樣式,style=”@style/xxxxxxxxxxxx”
?
在TextView的左側(cè)放置小圖標(biāo)
使用左側(cè)圖標(biāo)屬性android:drawableLeft=”@android:drawable/xxxxxxxxxxx”,引用android系統(tǒng)的圖標(biāo),例如:@android:drawable/star_big_on
圖標(biāo)垂直居中對(duì)齊,使用對(duì)齊屬性 android:gravity=”center_vertical”
?
引導(dǎo)頁(yè)下面的小圓點(diǎn)
線性布局,橫向,ImageView,包裹內(nèi)容,整體居中
使用系統(tǒng)圖標(biāo) @android:drawable/presence_online
@android:drawable/presence_invisible
?
自定義按鈕狀態(tài)背景
在res/drawable/button.xml文件中定義,添加節(jié)點(diǎn)<selector>
定義按鈕按下?tīng)顟B(tài) 添加<item>節(jié)點(diǎn),設(shè)置狀態(tài)屬性android:state_pressed=”true”
設(shè)置圖片屬性android:drawable=”xxxx”
設(shè)置按鈕焦點(diǎn)狀態(tài) 添加<item>節(jié)點(diǎn),設(shè)置狀態(tài)屬性android:state_focus=”true”
定義按鈕默認(rèn)圖片 添加<item>節(jié)點(diǎn),設(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" ><TextViewandroid:layout_width="match_parent"android:layout_height="40dp"android:background="#2D89EF"android:gravity="center"android:text="1.手機(jī)防盜設(shè)置向?qū)?#34;android:textColor="#fff"android:textSize="18sp" /><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginLeft="10dp"android:layout_marginTop="8dp"android:text="手機(jī)防盜包含以下功能:"android:textSize="16sp" /><TextViewstyle="@style/guide_text_list"android:drawableLeft="@android:drawable/btn_star_big_on"android:text="SIM卡變更報(bào)警" /><TextViewstyle="@style/guide_text_list"android:drawableLeft="@android:drawable/btn_star_big_on"android:text="GPS追蹤" /><TextViewstyle="@style/guide_text_list"android:drawableLeft="@android:drawable/btn_star_big_on"android:text="遠(yuǎn)程數(shù)據(jù)銷(xiāo)毀" /><TextViewstyle="@style/guide_text_list"android:drawableLeft="@android:drawable/btn_star_big_on"android:text="遠(yuǎn)程鎖屏" /><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:gravity="center_horizontal"android:orientation="horizontal" ><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:src="@android:drawable/presence_online" /><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:src="@android:drawable/presence_invisible" /><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:src="@android:drawable/presence_invisible" /><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:src="@android:drawable/presence_invisible" /></LinearLayout><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="match_parent" ><Buttonandroid: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>?
轉(zhuǎn)載于:https://www.cnblogs.com/taoshihan/p/5373836.html
總結(jié)
以上是生活随笔為你收集整理的[android] 手机卫士设置向导页面的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Meteor项目实战 -- Next 0
- 下一篇: 经验38--新闻内容处理