布局中Suspicious size: this will make the view invisible, probably intended for layout_width的错误
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
>
<ListView
android:id="@+id/lv_grouplist"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</ListView>
<Button
android:layout_width="wrap_content"
android:layout_height="60dp"
android:text="创建群组"
android:background="@drawable/sellector_bt_bg"
/>
</LinearLayout>
- 当LinearLayout的方向为horizontal(水平)时,权重分配应针对于layout_width(宽度);当LinearLayout的方向为vertical(垂直)时,权重分配应针对于layout_height(长度)。如若颠倒,则会出现上述错,如上举例,LinearLayout默认为horizontal(水平)。