【问题标题】:i am using staggardGridView inside a scrollview with an image on top我在滚动视图中使用 staggardGridView,顶部有图像
【发布时间】:2015-04-25 15:59:23
【问题描述】:

我在滚动视图中使用 staggardGridView,顶部有图像。我想一起滚动图像和列表。 `

        <FrameLayout
            android:id="@+id/lighthouseFrameLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <ImageView
                android:id="@+id/lightHouseImage"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:adjustViewBounds="true"
                />
        </FrameLayout>
        <com.origamilabs.library.views.StaggeredGridView
            android:id="@+id/staggeredGridView2"
            staggered:numColumns="2"
            android:layout_below="@id/lighthouseFrameLayout"
            staggered:drawSelectorOnTop="true"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </RelativeLayout>

`

【问题讨论】:

    标签: android-layout android-listview scrollview


    【解决方案1】:

    首先,如果您使用的是列表视图,那么它可能是网格或简单列表。不需要滚动视图。因为在列表视图中它会自动滚动。来到带有列表的图像,然后首先添加滚动视图,然后在滚动视图中添加图像和列表视图。 Hva eyou 试过了!!请关注this!项目。如果对你有帮助,请投票。

    【讨论】:

    • 对不起,我只发布了我的 xml 的部分。我的 xml 和你提到的完全一样。但它不起作用
    • 先添加相对布局,再添加滚动视图、线性布局、图像视图、网格视图。它会起作用的。
    • 我试过你说的,但是还是不行。如果您看过 pinterest 应用程序,当我们单击 pinterest 列表视图的任何项目时,它会打开另一个活动;我想要的和那个类似。
    • 在单击列表视图项目时打开花药活动,然后您需要使用位置。类似 if(position==2) then intent.
    • 我可以在下一个活动中打开相应的图像。列表视图也会出现,但它们都不会一起滚动。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多