gpt4 book ai didi

android - 我想要像 scrollview 这样的 google play 商店

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:27:40 27 4
gpt4 key购买 nike

我需要像 ScrollView 水平 View 这样的游戏商店,但我无法实现它。

如果可能的话,我已经尝试过这段代码,请也提供一个链接。

   <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<HorizontalScrollView
android:id="@+id/horizontalScrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:scrollbars="horizontal" >
<GridView
android:layout_width="500dp"
android:layout_height="400dp"
android:id="@+id/gridview"
android:columnWidth="300dp"
android:numColumns="3"
android:horizontalSpacing="10dp"
android:scrollbars="horizontal">
</GridView>
</HorizontalScrollView>
</RelativeLayout>

我想在我的应用中使用这种类型的 View ,请查看屏幕截图:

最佳答案

你可以为此使用 RecylerView。

 LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());    
linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);

RecylerView.setLayoutManager(linearLayoutManager);

关于android - 我想要像 scrollview 这样的 google play 商店,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33780479/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com