2
我有一个ListActivity声明如下机器人,在列表项显示箭头图标
public class SelectSiteActivity extends ListActivity
然后,我有这样的
public class SiteListAdapter extends ArrayAdapter<SimpleSiteModel>
自定义适配器和我的布局看起来像这样
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:background="#ffffff">
<TextView
android:id="@+id/siteName"
android:textColor="#000000"
android:text="Site Name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp" />
<ImageView
android:id="@+id/siteListMoreImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/expander_ic_minimized" />
</LinearLayout>
我怎样才能让ImageView
一直按到右边,以便它们都对准垂直然后TextView
占据了该行的其余部分,因此它们都在中心垂直对齐?
它是`android:gravity =“center_vertical”`,但其他一切都像冠军一样工作。 – Josh 2011-02-22 18:26:15