开发者

Android RelativeLayout position issue

开发者 https://www.devze.com 2023-03-14 12:27 出处:网络
Hi I have RelativeLayout below and somehow the @+id/tvPrice just dont show out. can anyone helps? Thanks.

Hi I have RelativeLayout below and somehow the @+id/tvPrice just dont show out. can anyone helps? Thanks.

Image link: http://bit.ly/izLhFO

layout xml:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_p开发者_开发知识库arent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:padding="6dip">
    <ImageView android:id="@+id/logo"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_alignParentTop="true"
        android:layout_alignParentBottom="true"
        android:layout_marginRight="6dip"
        android:src="@drawable/parkvilla" />

    <TextView android:layout_width="fill_parent"
        android:id="@+id/tvName"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_alignWithParentIfMissing="true"
        android:gravity="center_vertical"
        android:text="Name" android:typeface="sans" 
        android:textSize="18sp" android:textStyle="bold"
        android:singleLine="true"
        android:layout_toRightOf="@+id/logo"/>

    <TextView android:id="@+id/tvPrice"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:singleLine="true"
        android:ellipsize="marquee"
        android:text="Price" 
        android:textSize="13sp" 
        android:layout_above="@+id/tvSize"
        android:layout_toRightOf="@+id/logo"/>

    <TextView android:id="@+id/tvSize"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:singleLine="true"
        android:ellipsize="marquee"
        android:text="Size" 
        android:textSize="13sp" 
        android:layout_toRightOf="@+id/logo"/>

</RelativeLayout>


try adding android:layout_below="@id/tvName" to tvPrice.

0

精彩评论

暂无评论...
验证码 换一张
取 消