布局细节问题

在此布局中,需要注意的是在子布局中不能设置,
android:layout_alignParentRight=”true”
android:layout_centerInParent=”true”
android:layout_marginRight=”10dp”
否则,会影响中间布局的显示。

<RelativeLayout
        android:id="@+id/layout_right"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerInParent="true"
        android:layout_marginRight="10dp" >

        <ImageView
            android:id="@+id/iv_more_select"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/btn_more_select"
            android:contentDescription="@string/imageview_null"
            android:focusable="false" />

        <!-- 播发按钮,仅Fm使用 -->
        <ImageView
            android:id="@+id/iv_play"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/ic_play_list_state"
            android:contentDescription="@string/imageview_null"
            android:focusable="false"
            android:visibility="gone" />
    </RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bg_listview_select"
    android:paddingLeft="10dp" >

    <ImageView
        android:layout_width="1dp"
        android:layout_height="70dp"
        android:background="@drawable/ic_item_height"
        android:contentDescription="@string/imageview_null" />

    <RelativeLayout
        android:id="@+id/layout_left"
        android:layout_width="60dp"
        android:layout_height="70dp"
        android:layout_alignParentLeft="true"
        android:layout_centerInParent="true"
        android:paddingBottom="10dp"
        android:paddingRight="10dp"
        android:paddingTop="10dp" >

        <TextView
            android:id="@+id/tv_serial_number"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:gravity="center"
            android:text="1"
            android:textColor="#A8A8A8"
            android:textSize="12sp"
            android:visibility="invisible" />

        <ImageView
            android:id="@+id/iv_playing_marker"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:background="@drawable/ic_playing_marker"
            android:contentDescription="@string/imageview_null" />

        <ImageView
            android:id="@+id/iv_cover"
            android:layout_width="60dp"
            android:layout_height="70dp"
            android:background="@color/transparent"
            android:contentDescription="@string/imageview_null"
            android:scaleType="fitXY" />
    </RelativeLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_toLeftOf="@+id/layout_right"
        android:layout_toRightOf="@+id/layout_left"
        android:orientation="vertical"
        android:paddingRight="12dp" >

        <TextView
            android:id="@+id/tv_song_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ellipsize="end"
            android:gravity="center_vertical"
            android:maxLines="2"
            android:text="123123123"
            android:textColor="#808080"
            android:textSize="@dimen/song_list_title_text_size" />

        <TextView
            android:id="@+id/tv_song_sub_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ellipsize="end"
            android:gravity="center_vertical"
            android:lines="1"
            android:text=""
            android:textColor="#A8A8A8"
            android:textSize="@dimen/song_list_subhead_text_size"
            android:visibility="gone" />
    </LinearLayout>

    <RelativeLayout
        android:id="@+id/layout_right"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerInParent="true"
        android:layout_marginRight="10dp" >

        <ImageView
            android:id="@+id/iv_more_select"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/btn_more_select"
            android:contentDescription="@string/imageview_null"
            android:focusable="false" />

        <!-- 播发按钮,仅Fm使用 -->
        <ImageView
            android:id="@+id/iv_play"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/ic_play_list_state"
            android:contentDescription="@string/imageview_null"
            android:focusable="false"
            android:visibility="gone" />
    </RelativeLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="0.5dp"
        android:layout_alignParentBottom="true"
        android:background="@color/listview_divider" />

</RelativeLayout>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值