我在 Linearlayout 中有 tablelayout 但它向我显示了此警告消息
这个TableLayout布局或其LinearLayout父级是没有用的
如何克服这个警告可以帮助我。
提前致谢
<?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" >
<TableLayout>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" >
<TextView
android:id="@+id/txtPass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:text="Password"
android:textSize="18sp"
android:width="100dp" />
<EditText
android:id="@+id/edPass"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:password="true" >
<requestFocus />
</EditText>
</TableRow>
</TableLayout>
</LinearLayout>
当 LinearLayout 中除了 TableLayout 之外没有任何东西时,为什么还需要最顶层的 LinearLayout?这些布局之一应该足够了。删除 LinearLayout(或)TableLayout。这应该可以解决问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)