这TableLayout布局或其母公司的LinearLayout也没用如何从这一警告解决 [英] This TableLayout layout or its LinearLayout parent is useless how to resolve from this warning

查看:186
本文介绍了这TableLayout布局或其母公司的LinearLayout也没用如何从这一警告解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经tablelayout里面的LinearLayout,但它表明我这个警告信息结果
 这TableLayout布局或其母公司的LinearLayout是没用的
 如何从这个警告克服ANE能帮助我。
 在此先感谢

 <?XML版本=1.0编码=UTF-8&GT?;
      < LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
          机器人:layout_width =match_parent
          机器人:layout_height =match_parent>          < TableLayout>            <的TableRow
                机器人:ID =@ + ID / tableRow3
                机器人:layout_width =WRAP_CONTENT
                机器人:layout_height =WRAP_CONTENT
                机器人:layout_gravity =中心>                <的TextView
                    机器人:ID =@ + ID / txtPass
                    机器人:layout_width =WRAP_CONTENT
                    机器人:layout_height =WRAP_CONTENT
                    机器人:layout_gravity =center_vertical | CENTER_HORIZONTAL
                    机器人:文字=密码
                    机器人:TEXTSIZE =18sp
                    机器人:宽=100dp/>                <的EditText
                    机器人:ID =@ + ID / edPass
                    机器人:layout_width =200dp
                    机器人:layout_height =WRAP_CONTENT
                    安卓的inputType =textPassword
                    机器人:密码=真正的>                    < requestFocus的/>
                < /&的EditText GT;
              < /&的TableRow GT;
          < / TableLayout>      < / LinearLayout中>


解决方案

为什么需要最顶端的LinearLayout当你没有内部的LinearLayout任何东西,除了TableLayout?其中一个布局应该是足够了。无论是删除的LinearLayout(或)TableLayout。这应该解决这个问题。

I have tablelayout inside linearlayout but it shows me this warning message
This TableLayout layout or its LinearLayout parent is useless how to overcome from this warning can ane help me . Thanks in advance

<?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>

解决方案

Why do you need top most LinearLayout when you dont have anything inside LinearLayout except TableLayout? One of these layout should be enough. Remove either LinearLayout (or) TableLayout. That should resolve the issue.

这篇关于这TableLayout布局或其母公司的LinearLayout也没用如何从这一警告解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆