How to get the font face size and formatting of a native element in Android application?

只愿长相守 提交于 2019-12-11 20:09:20

问题


I would like to reuse the exact same font-face etc... like Android uses in the PreferenceScreen

Here is a screenshot I am looking to reuse the title, and the summary style from these views.

alt text http://www.eyeonweb.com/android/images/l2.png


回答1:


You can use system-defined text appearances like android:textAppearance="?android:attr/textAppearanceLarge (also Small, Medium).

For more on these system-defined attributes, see:

  • http://developer.android.com/reference/android/R.attr.html

There's also the hierarchyviewer tool that is bundled with the SDK, which will let you inspect views and their attributes from any running app.



来源:https://stackoverflow.com/questions/2404839/how-to-get-the-font-face-size-and-formatting-of-a-native-element-in-android-appl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!