我对按钮中的文本大小有疑问。我有使用 weightSum 的布局,我的按钮宽度与父级匹配,高度为 30%。一切正常,但是当我在模拟器上更改屏幕大小时,我的文本仍然很小。如何根据屏幕大小更改文本大小?这是xml:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="100" >
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button"
android:layout_weight="30" />
</LinearLayout>
有什么办法可以自动做到这一点?