简体   繁体   English

样式文字Android Wear卡片段

[英]Style Text Android Wear Card Fragment

For my Android Wear application I have a few card fragments in a FragmentGridPagerAdapter. 对于我的Android Wear应用程序,我在FragmentGridPagerAdapter中有一些卡片片段。 However the font size for the title and text in the cards is very small. 但是,卡片中标题和文本的字体大小很小。

Is it possible to style the title and text in a card fragment using different font types and font sizes? 是否可以使用不同的字体类型和字体大小在卡片片段中设置标题和文本的样式? If so, how would you go about doing this? 如果是这样,您将如何进行?

Cheers. 干杯。

You can change the content of your Card Fragment and so change textSize in the layout of your Fragment : 您可以更改卡片片段的内容,因此可以在片段的布局中更改textSize:

<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>

Show the documentation here . 在此处显示文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM