Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

i want google play store like scrollview

I need the play store like scroll view horizontal view but i cannot able to achieve it.

I had tried this code if possible please provide a link also.

   <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>

I want this type of View in my app please check screenshot:

like image 264
Ayub baba Avatar asked Mar 14 '23 03:03

Ayub baba


1 Answers

you can use RecylerView for this.

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

    RecylerView.setLayoutManager(linearLayoutManager);
like image 160
Ali Gürelli Avatar answered Mar 23 '23 13:03

Ali Gürelli