Skip to content Skip to sidebar Skip to footer

Missing Textappearances.micro Style

According to Android Developer Design Style for Typography, there are 4 TextAppearances (Micro, Small, Medium, Large). But there is no predefined style for Micro: ?android:attr/tex

Solution 1:

Good question! After researching a little bit, I didn't find any results for "TextAppearance.Micro".

On the other hand, I found the official Android source for style resource related to TextAppearances.

<stylename="TextAppearance.Small"><itemname="android:textSize">14sp</item><itemname="android:textColor">?textColorSecondary</item></style><stylename="TextAppearance.Medium"><itemname="android:textSize">18sp</item></style><stylename="TextAppearance.Large"><itemname="android:textSize">22sp</item></style>

As you can see, all of them only affect the text size (except TextAppearance.Small, which also affect the text color). So, I can safely say that the site displays the text sizes as a guideline only. On the other hand, you can always add a custom style to support TextAppearance.Micro! Just insert this inside styles.xml.

<stylename="TextAppearance.Micro"parent="@android:style/TextAppearance.Small"><itemname="android:textSize">12sp</item></style>

and use it like:

<TextView...android:textAppearance="@style/TextAppearance.Micro" />

On a bit related note, when I searched "textAppearanceMicro", I found 3 projects on GitHub. All of them adding some custom attributes, which one of them is textAppearanceMicro. Also, all of them are using ActionBarSherlock. I don't know whether there is a connection between textAppearanceMicro and ActionBarSherlock, but I didn't find that attribute was used anywhere in the code.

Solution 2:

If you happen to use the Google AppCompat Library, you can use the following:

<TextViewandroid:layout_width="match_parent"android:layout_height="wrap_content"android:textAppearance="@style/TextAppearance.AppCompat.Caption" />

Post a Comment for "Missing Textappearances.micro Style"