
我认为这应该是正确的,但我必须在xml文件中做错.你知道出了什么问题吗?
<tableLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:tools="http://schemas.androID.com/tools" tools:context=".LoginActivity" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" > <tableRow androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" > <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:paddingleft="5dp" androID:paddingRight="15dp" androID:textAppearance="?androID:attr/textAppearanceMedium" androID:text="@string/evUsername" /> <EditText androID:ID="@+ID/username" androID:layout_wIDth="0dp" androID:layout_height="wrap_content" androID:layout_weight="1" androID:inputType="text" /> </tableRow> <tableRow androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" > <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:paddingleft="5dp" androID:paddingRight="15dp" androID:textAppearance="?androID:attr/textAppearanceMedium" androID:text="@string/evPassword" /> <EditText androID:ID="@+ID/password" androID:layout_wIDth="0dp" androID:layout_height="wrap_content" androID:layout_weight="1" androID:inputType="textPassword" /> </tableRow> <tableRow androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" > <button androID:ID="@+ID/btnLogin" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:layout_span="2" androID:text="@string/btnLogin" /> </tableRow></tableLayout>
提前致谢!
解决方法 最后,我将tableLayout包装在linearLayout中,然后在tableLayout之后添加了button.<linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:tools="http://schemas.androID.com/tools" tools:context=".LoginActivity" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:orIEntation="vertical" > <tableLayout androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" > <tableRow androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" > <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:paddingleft="5dp" androID:paddingRight="15dp" androID:textAppearance="?androID:attr/textAppearanceMedium" androID:text="@string/evUsername" /> <EditText androID:ID="@+ID/username" androID:layout_wIDth="0dp" androID:layout_height="wrap_content" androID:layout_weight="1" androID:inputType="text" /> </tableRow> <tableRow androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" > <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:paddingleft="5dp" androID:paddingRight="15dp" androID:textAppearance="?androID:attr/textAppearanceMedium" androID:text="@string/evPassword" /> <EditText androID:ID="@+ID/password" androID:layout_wIDth="0dp" androID:layout_height="wrap_content" androID:layout_weight="1" androID:inputType="textPassword" /> </tableRow> </tableLayout> <button androID:ID="@+ID/btnLogin" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:text="@string/btnLogin" /></linearLayout>总结
以上是内存溢出为你收集整理的Android中的TableLayout中的layout_span全部内容,希望文章能够帮你解决Android中的TableLayout中的layout_span所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)