样式文字 Android 穿卡碎片

Style Text Android Wear Card Fragment

对于我的 Android Wear 应用程序,我在 FragmentGridPagerAdapter 中有一些卡片片段。然而,卡片中标题和文本的字体非常小。

是否可以使用不同的字体类型和字体大小来设置卡片片段中标题和文本的样式?如果是这样,你会怎么做?

干杯。

您可以更改卡片片段的内容,从而更改片段布局中的文本大小:

<android.support.wearable.view.CardFrame
    android:layout_height="wrap_content"
    android:layout_width="fill_parent">

    <LinearLayout
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:orientation="vertical"
        android:paddingLeft="5dp">

        <TextView
            android:fontFamily="sans-serif-light"
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:text="@string/custom_card"
            android:textColor="@color/black"
            android:textSize="20sp"/>

        <TextView
            android:fontFamily="sans-serif-light"
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:text="@string/description"
            android:textColor="@color/black"
            android:textSize="14sp"/>

    </LinearLayout>

</android.support.wearable.view.CardFrame>

显示the documentation here.