1

I tried all ways to get this GridView part in the layout scroll-able horizontally, i also put android:scrollbars="horizontal" but still scrolls vertical.. please any help ?

Main.xml

<?xml version="1.0" encoding="utf-8"?><TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0.01" />

    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="0.41">    
    </FrameLayout>


        <GridView 
            android:id="@+id/gridView"
            android:numColumns="auto_fit"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="0.1"
            android:columnWidth="100dp"
            android:horizontalSpacing="10dp"
            android:stretchMode="columnWidth"
            android:transcriptMode="alwaysScroll"
            android:paddingRight="30dp"
            android:paddingLeft="30dp"
            android:clipToPadding="true"
            android:fitsSystemWindows="true"
            android:background="#E8E8E8"
            android:scrollbars="horizontal" >
        </GridView> 



    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >
        <Button
            android:id="@+id/bOrder"
            android:layout_width="fill_parent"
            android:layout_height="40dp"
            android:layout_marginTop="5dp"
            android:text="View Your Order"
            android:textSize="20sp"
             />

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/bFeedback"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:layout_weight="0.50"
            android:text="Feedback"
            android:textSize="20sp" />

        <Button
            android:id="@+id/bCallWaiter"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:layout_weight="0.50"
            android:text="Call Waiter"
            android:textSize="20sp" />

    </LinearLayout>

    </LinearLayout>

</LinearLayout>

  • try this: http://stackoverflow.com/questions/15919060/how-to-make-grid-view-scroll-horizontally-not-vertically-in-android –  Sep 09 '14 at 15:34
  • Look into this [post](http://stackoverflow.com/a/5725850/3326331) – Sagar Pilkhwal Sep 09 '14 at 15:40
  • i tried it, it doesn't work, it just crunchs all the items into the viewport and i did fix the GridView width, still same problem.. i also put GridView in HorizontalScrollView , but it can't be filled. i don't know whats wrong – user3585658 Sep 09 '14 at 16:01

0 Answers0