【发布时间】:2011-04-01 15:04:06
【问题描述】:
我不太明白我的列表视图项的布局没有像我想要的那样显示。 我希望有人能给我一些提示,因为我现在已经有一段时间无法让它工作了。 我想要的如下:
这是我的方法:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="20dip"
android:padding="6dip">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="3dip">
<TextView
android:id="@+id/nametext"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="7dip">
<ImageView
android:id="@+id/photo"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="6dip"
android:src="@drawable/icon" />
<LinearLayout
android:orientation="vertical"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="fill_parent">
<TextView
android:id="@+id/toptext"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:gravity="center_vertical"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:id="@+id/middletext"
android:singleLine="true"
android:ellipsize="marquee"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:id="@+id/bottomtext"
android:singleLine="true"
android:ellipsize="marquee"
/>
</LinearLayout>
<ImageView
android:id="@+id/stars"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginLeft="6dip"
android:src="@drawable/icon" />
</LinearLayout>
任何帮助将不胜感激。 我已经尝试过不同的尺寸和相对布局。没变。 它看起来不像我认为的那样。
编辑三个缺失的空白
edit2 添加图片
【问题讨论】:
-
对不起。整个 xml 代码在文本中,但不会显示。请任何可以编辑,更改此内容的人,我不知道如何。要查看完整的 xml,请使用编辑模式。很抱歉给您带来不便。
标签: java android xml intellij-idea