【问题标题】:Multiple scroll view android多滚动视图android
【发布时间】:2013-04-17 15:26:38
【问题描述】:

我有一个可扩展列表视图,上面有一个包含图像的相对布局。我想同时滚动列表视图和上述布局?有可能吗?

<RelativeLayout
    android:id="@+id/thumbnail"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_marginLeft="15dip"
    android:layout_marginTop="38dip"
    android:padding="3dip" >

        <ImageView
            android:id="@+id/list_image"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/sss" />
    </RelativeLayout>

<RelativeLayout
    android:id="@+id/topbarsecond"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

 <ExpandableListView
    android:id="@+id/expandableListView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="5dip"
    android:layout_marginRight="5dip"
    android:layout_marginBottom="25dip"
    android:layout_marginTop="5dip"
    android:layout_alignParentLeft="true"
    android:cacheColorHint="#00000000"
    android:divider="#d6d7da"
    android:dividerHeight="5dp"
    android:groupIndicator="@null"
    android:layout_alignParentTop="true" >
</ExpandableListView>

【问题讨论】:

    标签: android scroll expandablelistview


    【解决方案1】:

    只需将所有视图(包括 ListView)放入布局中,然后将其放入 ScrollView

    【讨论】:

      【解决方案2】:

      您可以将RelativeLayout添加为ExpandableListView的HeaderView。

      ListView#addHeaderView(View v)
      

      请参考this

      【讨论】:

        【解决方案3】:

        由于默认情况下列表已经有一个滚动视图,添加另一个滚动视图可能无法正常工作,因此尝试在没有列表视图的封闭布局中放置一个单独的滚动视图,这可能会解决您的目的。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2011-03-04
          • 2011-05-14
          • 2015-08-10
          • 2014-04-20
          相关资源
          最近更新 更多