android 可以統(tǒng)一定義一致的style, 在相應(yīng)的widget中使用.
使用方法: 
1. 在res/values/中添加 styles.xml, 名稱自定義,可以隨便,但為了辨識區(qū)分,最好使用styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="PasswordText"><item name="android:textSize">40dp</item>
<item name="android:textColor">@color/black</item>

<item name="android:gravity">center</item>
<item name="android:minWidth">65dp</item>
<item name="android:minHeight">65dp</item>
<item name="android:background">#99ccff</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
</style>
</resources>
在這個文件里面定義上述,style (新建文件時,<resources xmlns:android="http://schemas.android.com/apk/res/android"> 需添加這句話 ,否則會出現(xiàn)nullpointException 異常
2. 在相應(yīng)的widget上添加 style="@style/PasswordText" 就可以使用了