无法在Android水平列表视图上滚动图像

时间:2014-07-24 03:23:18

标签: android android-layout android-activity android-fragments

您好我正在使用此库中的水平列表视图 https://github.com/MeetMe

我使用了包含imagebutton和textview的适配器 但是当我从图像滚动时它不会滚动 我不知道为什么

你可以帮帮我吗?

main.xml中

<com.meetme.android.horizontallistview.HorizontalListView
android:id="@+id/hlvCustomListFriends"
android:layout_width="wrap_content"
android:layout_height="200dp" 
android:layout_alignParentLeft="true"
android:layout_below="@+id/shared_friends"
android:paddingBottom="10dp"/>

adapter.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" 
android:layout_margin="5dp">

<ImageButton
    android:id="@+id/imageButton_aaa"
    android:layout_width="80dp"
    android:layout_height="80dp"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:background="@null"
    android:padding="5dp"
    android:src="@drawable/icon_editbar_profile" />

<TextView
    android:id="@+id/textView_aaa"
    android:layout_width="80dp"
    android:layout_height="match_parent"
    android:layout_alignParentBottom="true"
    android:layout_below="@+id/imageButton_aaa"
    android:layout_centerHorizontal="true"
    android:gravity="center_horizontal"
    android:text="dd"
    android:textAppearance="?android:attr/textAppearanceMedium" />

</RelativeLayout>

3 个答案:

答案 0 :(得分:4)

我一直在使用您正在使用的相同库并且遇到了与您相同的问题,并且在您使用的库的限制中也提到了这样,所以最好转到另一个我发布的链接这会像魅力一样。

使用这个水平列表视图我正在使用这个,它有正确的实现,即使滚动列表器可以实现像我的魅力。

https://github.com/sephiroth74/HorizontalVariableListView

对于eclipse

https://mega.co.nz/#!REAnkAwb!NH9JYrVJkthJAFdMsTGQHYOGmLYCW-RLAUPX1b2PFBY 因为作者没有发布使用eclipse的文件,Umer制作了文件并将其上传到Disonash(Devon)MEGA空间,希望每个人都可以使用它。如果你需要它。

答案 1 :(得分:0)

将main.xml替换为下面的一个:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:widget="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

 <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

 <com.meetme.android.horizontallistview.HorizontalListView
 android:id="@+id/hlvCustomListFriends"
 android:layout_width="wrap_content"
 android:layout_height="200dp" 
 android:layout_alignParentLeft="true"
 android:layout_below="@+id/shared_friends"
 android:paddingBottom="10dp"/>

</LinearLayout>

</ScrollView>

答案 2 :(得分:0)

如果删除imageButton,可以使用滚动?...

如果您有自定义listView并且需要使用ImageButton的单击,则需要使用android:clickable =&#34; false&#34;在你的清单中,