Android預定義樣式

對於能夠顯示文字的控件(如TextView EditText RadioButton Button CheckBox Chronometer等等),你有時需要控制字體的大小。Android平臺定義了三種字體大小。

"?android:attr/textAppearanceLarge"

"?android:attr/textAppearanceMedium"

"?android:attr/textAppearanceSmall"

使用方法爲:

android:textAppearance="?android:attr/textAppearanceLarge" 
android:textAppearance="?android:attr/textAppearanceMedium" 
android:textAppearance="?android:attr/textAppearanceSmall"

style="?android:attr/textAppearanceLarge" 
style="?android:attr/textAppearanceMedium" 
style="?android:attr/textAppearanceSmall"

字體顏色

android:textColor="?android:attr/textColorPrimary" 
android:textColor="?android:attr/textColorSecondary" 
android:textColor="?android:attr/textColorTertiary" 
android:textColor="?android:attr/textColorPrimaryInverse" 
android:textColor="?android:attr/textColorSecondaryInverse"

ProgressBar

style="?android:attr/progressBarStyleHorizontal" 
style="?android:attr/progressBarStyleLarge" 
style="?android:attr/progressBarStyleSmall" 
style="?android:attr/progressBarStyleSmallTitle"

分隔符

橫向:

<View android:layout_width="fill_parent" 
      android:layout_height="1dip" 
      android:background="?android:attr/listDivider" />

縱向:

<View android:layout_width="1dip" 
      android:layout_height="fill_parent" 
      android:background="?android:attr/listDivider" />

CheckBox

style="?android:attr/starStyle"

類似標題欄效果的TextView

style="?android:attr/listSeparatorTextViewStyle"

其它有用的樣式

android:layout_height="?android:attr/listPreferredItemHeight"

android:paddingRight="?android:attr/scrollbarSize"

style="?android:attr/windowTitleBackgroundStyle"

style="?android:attr/windowTitleStyle"

android:layout_height="?android:attr/windowTitleSize"

android:background="?android:attr/windowBackground"

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章