代码片段(5)[全屏查看所有代码]
3. [代码]themes.xml
01 | <!-- Window attributes --> |
02 | < item name = "windowBackground" >@android:drawable/screen_background_dark</ item > |
03 | < item name = "windowFrame" >@null</ item > |
04 | < item name = "windowNoTitle" >false</ item > |
05 | < item name = "windowFullscreen" >false</ item > |
06 | < item name = "windowIsFloating" >false</ item > |
07 | < item name = "windowContentOverlay" >@android:drawable/title_bar_shadow</ item > |
08 | < item name = "windowTitleStyle" >@android:style/WindowTitle</ item > |
09 | < item name = "windowTitleSize" >25dip</ item > |
10 | < item name = "windowTitleBackgroundStyle" >@android:style/WindowTitleBackground</ item > |
11 | < item name = "android:windowAnimationStyle" >@android:style/Animation.Activity</ item > |
4. [代码]styles.xml
01 | <? xml version = "1.0" encoding = "UTF-8" ?> |
02 | < resources > |
03 | < style name = "TextView" > |
04 | < item name = "android:textSize" >18sp</ item > |
05 | < item name = "android:textColor" >#008</ item > |
06 | < item name = "android:shadowColor" >@android:color/black</ item > |
07 | < item name = "android:shadowRadius" >2.0</ item > |
08 | </ style > |
09 | |
10 | < style name = "EditText" > |
11 | < item name = "android:shadowColor" >@android:color/black</ item > |
12 | < item name = "android:shadowRadius" >1.0</ item > |
13 | < item name = "android:background" >@android:drawable/btn_default</ item > |
14 | < item name = "android:textAppearance" >?android:attr/textAppearanceMedium</ item > |
15 | </ style > |
16 | |
17 | < style name = "Button" > |
18 | < item name = "android:background" >@android:drawable/edit_text</ item > |
19 | < item name = "android:textAppearance" >?android:attr/textAppearanceMedium</ item > |
20 | </ style > |
21 | </ resources > |
5. [代码]main.xml 跳至 [3] [4] [5] [全屏预览]
01 | <? xml version = "1.0" encoding = "utf-8" ?> |
02 | < LinearLayout xmlns:android = "http://schemas.android.com/apk/res/android" |
03 | android:orientation = "vertical" android:layout_width = "fill_parent" |
04 | android:layout_height = "fill_parent" > |
05 | < TextView android:layout_width = "fill_parent" |
06 | android:layout_height = "wrap_content" android:text = "@string/hello" |
07 | style = "@style/TextView" /> |
08 | < EditText android:id = "@+id/EditText01" android:layout_height = "wrap_content" |
09 | style = "@style/EditText" android:layout_width = "fill_parent" |
10 | android:text = "类似Button的EditText" ></ EditText > |
11 | < EditText android:id = "@+id/EditText02" android:layout_height = "wrap_content" |
12 | android:layout_width = "fill_parent" android:text = "普通的EditText" ></ EditText > |
13 | < Button android:id = "@+id/Button01" android:layout_height = "wrap_content" |
14 | style = "@style/Button" android:layout_width = "fill_parent" android:text = "类似EditText的Button" ></ Button > |
15 | </ LinearLayout > |