Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/190.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 如何在Gallery视图的末端设置图像(右侧和左侧)_Android_Android Gallery - Fatal编程技术网

Android 如何在Gallery视图的末端设置图像(右侧和左侧)

Android 如何在Gallery视图的末端设置图像(右侧和左侧),android,android-gallery,Android,Android Gallery,我需要帮助在我的图库视图的两端放置图像(后退和前进图像)。我有一个图库,可以列出要水平滚动的菜单,而这个图库是相对的。你如何在不滚动的情况下获得图库两端的图像 提前谢谢。答案就在你的问题本身。放在两侧的imageview。示例布局如下所示 <LinearLayout> <ImageView....../> <Gallery .../> <ImageView .../> </LinearLayout> 希望有

我需要帮助在我的图库视图的两端放置图像(后退和前进图像)。我有一个图库,可以列出要水平滚动的菜单,而这个图库是相对的。你如何在不滚动的情况下获得图库两端的图像


提前谢谢。

答案就在你的问题本身。放在两侧的
imageview
。示例布局如下所示

<LinearLayout>
    <ImageView....../>
    <Gallery .../>
    <ImageView .../>
</LinearLayout>


希望有帮助。

答案就在你的问题本身。放在两侧的
imageview
。示例布局如下所示

<LinearLayout>
    <ImageView....../>
    <Gallery .../>
    <ImageView .../>
</LinearLayout>


希望能有所帮助。

我会稍微修改一下Praveen的答案:

<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal">
    <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" />
    <Gallery android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1"/>
    <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>


android:layout_weight=“1”in在这里非常重要。

我想稍微修改一下Praveen的答案:

<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal">
    <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" />
    <Gallery android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1"/>
    <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>

android:layout_weight=“1”在这里非常重要