【发布时间】:2021-06-21 03:43:03
【问题描述】:
我的应用有一个textview,它的高度应该根据weight属性进行调整,但是它给出了红色错误。
代码是,
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:weightSum="10">
<TextView
android:textSize="50dp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:text="@string/hello_pleasse_login"
/>
</LinearLayout>
我也尝试过 android:layout_height="0dp" 和 android:layout_height="0" 但它不起作用, 请帮忙。
【问题讨论】:
标签: android android-layout android-linearlayout