use*_*954 0 android android-layout
我想在不同的分辨率中设置相同大小的文本.如何做到这一点.我也尝试创建两个新的文件夹,如layout-small,layout-large,layout-xlarge,layout-normal.但仍然没有管理它.请有人帮忙我的问题.谢谢.
在你的xml中使用类似的东西来设置文本的大小.它将独立于分辨率.
<TextView android:id="@+id/name_text"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textSize="10dp"
/>
Run Code Online (Sandbox Code Playgroud)
或者你可以在java代码中执行此操作
TextView text1 = (TextView) findViewById(R.id.txt);
text1.setTextSize(10);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
183 次 |
| 最近记录: |