简体   繁体   中英

Style Text Android Wear Card Fragment

For my Android Wear application I have a few card fragments in a 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 :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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