【发布时间】:2018-07-06 17:23:35
【问题描述】:
我的布局如何在不使用约束布局和使用 layout-small、layout-large、layout-normal 和 layout-xlarge 等文件夹的情况下支持不同的屏幕。我不想使用它们,因为我确实有很多布局。请帮我。 这是我的布局之一:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/job_order_no"
android:textSize="15sp"
android:textColor="#000"
android:fontFamily="@font/roboto_bold"
android:layout_weight="1"
android:text ="A"
/>
</LinearLayout>
【问题讨论】:
-
我无法创建另一个布局文件,因为它非常耗时并且我有十几个布局。您还有其他替代解决方案吗?喜欢以编程方式设置高度和宽度?也许使用 LayoutParams?
-
软件开发通常很耗时。