小编k_m*_*man的帖子

Android:如何为布局设置文本大小?

我试图在全球范围内设置文本大小,无法找到或找到一种方法.

例如,我有这样的事情:

<?xml version="1.0" encoding="utf-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:id = "@+id/Table"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
         android:shrinkColumns="*"  
         android:stretchColumns="*">
</TableLayout>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)

TableRows和TextViews本身是根据用户输入动态生成的.

问题是我想基于资源文件全局设置基本textSize,而不必去触及一堆代码.有没有办法告诉应用程序,"嘿应用程序,使用它作为所有textViews的基本textSize?"

或者用另一种方式表达,在HTML中我可以在body,div和table级别设置字体大小.我可以在布局(LinearLayout,TableLayout,ScrollView等)级别上做类似的事情吗?

android text-size android-layout

13
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

android-layout ×1

text-size ×1