Cómo Android define sus propios estilos y estilos de referencia en estilos.xml
Aquí están las partes relevantes del archivo estilos.xml:
[html] ¿Ver impresión de texto sin formato?
lt;style?name="text_font"gt;?
lt;item?name="android:textColor"gt;#05blt;/itemgt;?
lt;item?name="android:textSize"gt;18splt;/ itemgt;?
lt; item?name="android: textStyle"gt; negrita;/itemgt;?
lt;/stylegt;? ;style?name="content_font"gt;?
lt;item?name="android:textColor"gt;#0f5lt;/itemgt;?
lt;item?name ="android: textSize"gt; 18splt;/itemgt;?
lt; item?name="android: textStyle"gt;/itemgt;?
lt;/ stylegt;?
lt; estilo?name="hint_text_font"?parent="text_font"gt;?
lt; elemento?name="android: textColor"gt;#f00lt ;/itemgt;?
lt;/stylegt;?
lt;style name="text_font"gt;
lt;item name="android: textColor"gt;#05blt;/itemgt;
lt;item name="android.textSize"gt;18splt;/itemgt;
lt;item name="android: textStyle "gt;boldlt;/itemgt;
lt;/stylegt;
lt.style name="content_font"gt;
lt;item name="android:textColor"gt;#0f5lt;/itemgt;
lt;item name="android:textSize"gt.18splt;/itemgt;
lt;item name="android:textStyle"gt;normallt;/itemgt;
lt;/stylegt;
lt;style name=" hind_text_font " parent="text_font"gt;
lt; item name="android: textColor"gt; #f00lt;/itemgt;
lt;/stylegt;
Lo hacemos referencia en el elemento de la interfaz de esta manera:
[html] ¿Ver impresión de texto sin formato?
lt;TextView?style="@style/content_
font"?
android:id="@ id/textView1"?
android:layout_width="fill_parent"?
android:layout_height="wrap_content" ?
android:text="@string/hello_world"?/gt;?
lt;Button?style="@style/text_font"?
android:id="@ id/button1"?
android:layout_width="fill_parent"?
android:layout_height="wrap_content"?
android: text="@string/test_IntentService"?
android: text="@string/test_IntentService"
lt; TextView style="@style/hint_text_font"?
android:id="@ id/hint"?
android:text="@string/hint_text"?
android:layout_height="wrap_content"?
android: layout_width="fill_parent"?
android: layout_width="fill_parent"?
La captura de pantalla anterior se logra mediante estilos personalizados y el ejemplo es de Android. manual de aprendizaje, que contiene código fuente. El manual de aprendizaje de Android contiene 9 capítulos y 108 ejemplos. Puede leer los documentos del código fuente a voluntad. Los ejemplos son interactivos y se pueden ejecutar. está resaltado y todos los documentos están en el documento. El diagrama de estructura muestra que al descargar 360 Mobile Assistant, el ícono está en el shell: