AlexCheng

res/values/style.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="style1">
        <item name="android:textSize">18sp</item>
        <item name="android:textColor">#EC9273</item>
    </style>
    <style name="style2">
        <item name="android:textSize">14sp</item>
        <item name="android:textColor">#FF7F7C</item>
        <item name="android:fromAlpha">0.0</item>
        <item name="android:toAlpha">0.0</item>
    </style>
</resources>

res/layout/main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView 
	style="@style/style1" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
    <TextView
    style="@style/style2"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
</LinearLayout>

运行结果
image

分类:

技术点:

相关文章:

  • 2021-11-12
  • 2021-09-11
  • 2021-11-27
  • 2022-01-12
  • 2021-08-01
  • 2021-11-04
  • 2021-09-04
  • 2021-06-10
猜你喜欢
  • 2021-10-16
  • 2021-05-04
  • 2022-01-06
  • 2021-10-11
  • 2021-05-13
  • 2022-01-05
相关资源
相似解决方案