微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android – 这个TableLayout布局或其LinearLayout父级如何解决此警告是无用的

我在linelayout里面有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>

解决方法:

除了TableLayout之外,当你在LinearLayout里面没有任何东西时,为什么你需要最顶级的LinearLayout?其中一个布局应该足够了.删除LinearLayout(或)TableLayout.那应该解决这个问题.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐