我打开了hIErarchyvIEwer并查看了值,tableRow填充宽度,但TextVIEw没有填充行,它只是包装内容.完整的xml布局如下,有没有人有任何想法?
<?xml version="1.0" enCoding="utf-8"?><tableLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"androID:orIEntation="vertical"androID:layout_wIDth="fill_parent"androID:layout_height="fill_parent"><tableRow androID:layout_wIDth="match_parent" androID:layout_height="wrap_content"> <TextVIEw androID:background="@drawable/textlines" androID:text="@string/text1_string" androID:textcolor="#000000" androID:padding="5dp"> </TextVIEw></tableRow><tableRow androID:layout_wIDth="match_parent" androID:layout_height="wrap_content"> <TextVIEw androID:background="@drawable/textlines" androID:text="@string/text1_string" androID:textcolor="#000000" androID:padding="5dp"> </TextVIEw></tableRow><tableRow androID:layout_wIDth="match_parent" androID:layout_height="wrap_content"> <TextVIEw androID:background="@drawable/textlines" androID:text="@string/text1_string" androID:textcolor="#000000" androID:padding="5dp"> </TextVIEw></tableRow></tableLayout>
另外,我将包含@ drawable / textlines的xml文件.也许问题在那里? (文本行代码来自这里提供的关于边界问题的解决方案)我非常理解它,我认为它不应该影响我的问题,但我可能是错的.无论如何,这里是:
<?xml version="1.0" enCoding="utf-8"?><@R_620_3419@ xmlns:androID="http://schemas.androID.com/apk/res/androID" ><item> <shape androID:shape="rectangle"> <stroke androID:wIDth="1dp" androID:color="#FF000000" /> <solID androID:color="#FFddddDD" /> </shape></item><item androID:top="1dp" androID:bottom="1dp"> <shape androID:shape="rectangle"> <stroke androID:wIDth="1dp" androID:color="#FFddddDD" /> <solID androID:color="#00000000" /> </shape></item></@R_620_3419@>解决方法 我不知道为什么会这样,但你可以通过添加:
androID:layout_weight="1"
给你的孩子TextVIEws,或添加:
androID:stretchColumns="0"
到您的父tableLayout.
总结以上是内存溢出为你收集整理的Android TableRow儿童问题全部内容,希望文章能够帮你解决Android TableRow儿童问题所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)