我需要将一个ImageView和TextView放在一个RelativeLayout中。 我无法弄清楚我做错了什么。Centre RelativeLayout
这里是我的代码:
<RelativeLayout
android:id="@+id/teamNameLayout"
android:layout_width="130dip"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:background="@drawable/border"
android:layout_toLeftOf="@+id/teamPosition"
>
<ImageView
android:id="@+id/teamIcon"
android:src="@drawable/logo1"
android:layout_width="20dip"
android:layout_height="fill_parent"
android:scaleType="fitXY"
android:textStyle="bold"
android:textSize="16sp"
/>
<TextView android:id="@+id/teamName"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="16sp"
android:text="blabla" />
</RelativeLayout>
我已经试过了 “CENTER_HORIZONTAL”,但没有成功。 我需要ImageView将在TextView的右侧。
是否要将ImageView和TextView组合到视图的中心? – 2012-08-06 11:55:29
是的。而且我还需要为imageview中的textview填充内容。 – ohadinho 2012-08-06 12:13:36
RelativeLayout没有方向btw – banzai86 2012-08-06 12:41:13