LinearLayout崩溃Android [英] LinearLayout Crash Android
本文介绍了LinearLayout崩溃Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
当我把它放在我的list_item.xml中时,Android应用程序崩溃了。
< linearlayout>
xmlns:android =http://schemas.android.com/apk/res/android
android:layout_width =fill_parent
android:layout_height =fill_parent>
< textview xmlns:android =http://schemas.android.com/apk/res/android>
android:id =@ + id / mainList
android:layout_width =fill_parent
android:layout_height =50dip
android:textSize =12dip
android:autoLink =none
android:textColor =#5f646c
android:gravity =center_vertical
android:removed =#ffff
android: paddingLeft =10dip/>
如果我删除RelativeLayout它完美无缺。
这怎么可能?我该怎么办呢?
谢谢。
解决方案
试试这段代码:
< linearlayout >
xmlns:android =http://schemas.android.com/apk/res/android
android: layout_width =fill_parent
android:layout_height =fill_parent>
< textview < span class =code-attribute> xmlns:android = http://schemas.android。 com / apk / res / android >
android:id =@ + id / mainList
android:layout_width =fill_parent
android:layout_height =50dip
android:textSize =12dip
android:autoLink =none
android:textColor =#5f646c
android:gravity =center_vertical
android:removed =#ffff
android:paddingLeft =10dip/>
< / textview > < / linearlayout >
< linearlayout< br />
xmlns:android =http://schemas.android.com/ apk / res / android< br />
android:layout_width =fill_parent< br />
android:layout_height =fill_parent>< br />
< ; textview>< br />
android:id =@ + id / mainList< br />
android:layout_width =fill_parent< br />
android: layout_height =50dip< br />
android:textSize =12dip< br />
android:autoLink =none< br />
android:textColor = #5f646c< br />
android:gravity =center_vertical< br />
android:removed =#fff< br />
android:paddingLeft = 10dip/>< br />
< / linearlayout>
Hello,
When I put this in my list_item.xml the android app crashes.
<linearlayout> xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <textview xmlns:android="http://schemas.android.com/apk/res/android"> android:id="@+id/mainList" android:layout_width="fill_parent" android:layout_height="50dip" android:textSize="12dip" android:autoLink="none" android:textColor="#5f646c" android:gravity="center_vertical" android:removed="#fff" android:paddingLeft="10dip" />
If I remove the RelativeLayout it works perfectly.
How is this possibly? And how can I fix this?
Thanks.
解决方案
hi,try this code:
<linearlayout> xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <textview xmlns:android="http://schemas.android.com/apk/res/android"> android:id="@+id/mainList" android:layout_width="fill_parent" android:layout_height="50dip" android:textSize="12dip" android:autoLink="none" android:textColor="#5f646c" android:gravity="center_vertical" android:removed="#fff" android:paddingLeft="10dip" /> </textview></linearlayout>
<linearlayout<br /> xmlns:android="http://schemas.android.com/apk/res/android"<br /> android:layout_width="fill_parent"<br /> android:layout_height="fill_parent"><br /> <textview><br /> android:id="@+id/mainList"<br /> android:layout_width="fill_parent"<br /> android:layout_height="50dip"<br /> android:textSize="12dip"<br /> android:autoLink="none"<br /> android:textColor="#5f646c"<br /> android:gravity="center_vertical"<br /> android:removed="#fff"<br /> android:paddingLeft="10dip" /><br /> </linearlayout>
这篇关于LinearLayout崩溃Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文