Android使用ScrollView和自定义的ListView实现两列的ListView

1、为了实现两列的ListView

首先我们需要定义一个每一项的布局文件music_find_music_menu_item.xml

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

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dp"
        android:layout_marginRight="10dp"
        android:layout_weight="1">

        <RelativeLayout
            android:id="@+id/music_menu_image_left"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="4"
            android:visibility="invisible"
            android:background="@drawable/ic_launcher">

            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_alignParentRight="true"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true">

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_weight="6">

                </LinearLayout>

                <RelativeLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="4">

                    <TextView
                        android:id="@+id/listen_timer_left"
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:layout_alignParentRight="true"
                        android:gravity="center_vertical"
                        android:text="1231313113"/>

                    <ImageView
                        android:id="@+id/ear_phone_left"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_toLeftOf="@id/listen_timer_left"
                        android:src="@drawable/ic_launcher"/>

                </RelativeLayout>

            </LinearLayout>
            
            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_alignParentLeft="true"
                android:layout_alignParentBottom="true"
                android:layout_height="30dp">

                <ImageView
                    android:id="@+id/user_image_icon_left"
                    android:layout_width="wrap_content"
                    an
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值