Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android如何设置此GridView水平滚动_Android - Fatal编程技术网

Android如何设置此GridView水平滚动

Android如何设置此GridView水平滚动,android,Android,我尝试了所有的方法让这个GridView部分在布局中可以水平滚动,我也把android:scrollbars=“horizontal”放到了垂直滚动的位置。。有什么需要帮忙的吗 Main.xml <?xml version="1.0" encoding="utf-8"?><TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" andr

我尝试了所有的方法让这个GridView部分在布局中可以水平滚动,我也把
android:scrollbars=“horizontal”
放到了垂直滚动的位置。。有什么需要帮忙的吗

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>


试试这个:看看这个我试过了,它不起作用,它只是将所有项目压缩到视口中,我确实修复了GridView的宽度,仍然存在同样的问题。。我还将GridView放在了HorizontalScrollView中,但它不能被填充。我不知道怎么了