0

Nested a GridView with 22 items into HorizontalScrollView. GridView has 22 item, 4 column 6 rows, in the last only 2 item placed without nesting. But after nesting only the first column appears, so 1 column and 6 rows with images. Why not all the item with horizontal scrolling option? I guess something wrong, or missing from HorizontalScrollView setup.

   <HorizontalScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/seatLegendLayout">

        <GridView
            android:id="@+id/gridView1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="4dp"
            android:columnWidth="100dp"
            android:gravity="center"
            android:numColumns="4"
            android:horizontalSpacing="1dp"
            android:scrollbarAlwaysDrawHorizontalTrack="true"
            android:scrollbarAlwaysDrawVerticalTrack="true"
            android:scrollbars="horizontal"
            android:stretchMode="none"
            android:verticalSpacing="1dp">

        </GridView>

    </HorizontalScrollView>
János
  • 32,867
  • 38
  • 193
  • 353
  • short answer: you cant do gridview horizontally, not this way at least. if you really want to get your hand dirty, see this - http://stackoverflow.com/questions/5725745/horizontal-scrolling-grid-view – hello_world Jul 12 '16 at 18:34
  • also, please look into RecyclerView with GridLayoutManager set horizontally. – hello_world Jul 12 '16 at 18:36
  • I have this layout structure: `RelativeLayout` > `HorizontalScrollView` > `GridView`. No `RecyclerView` exist. – János Jul 12 '16 at 19:15
  • you need to add dependency in gradle. please follow this -> http://www.androidhive.info/2016/01/android-working-with-recycler-view/ and this -> http://inducesmile.com/android/android-gridlayoutmanager-with-recyclerview-in-material-design/ – hello_world Jul 12 '16 at 19:33

1 Answers1

0

I have used TwoWayListView to make horizental list views, it worked fine when I was using eclipse.

After migrating my apps to android studio I am using RecylerView, it is giving me what i need to put lists in horizontal or vertical orientation, it also support grids, and cards

Try to read about this, it is the most common used for developing those days

Good luck

Firas Shrourou
  • 625
  • 8
  • 19
  • RecyclerView can only scroll in one way horizontal or vertical? Because I need be able to scroll in both way. – János Jul 13 '16 at 14:22