画廊的观点并没有从左边开始 [英] Gallery view is not starting from left

查看:128
本文介绍了画廊的观点并没有从左边开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的库这样

<Gallery
    android:id="@+id/gallery1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="10dp"
    android:spacing="2dp" >
</Gallery>

但是当我运行了code我发现画廊从中年开始,我想从左边开始吧。我应该怎么做这个,请帮助我。

but when I am running the code I am finding gallery starting from middle and I want to start it from left. what should I do for this please help me.

推荐答案

刚刚成立画廊的选择下一个,这类似于该库在左侧位置。

just set the selection of Gallery to next, which resemble that gallery is in Left position.

Gallery mGallery= (Gallery) findViewById(R.id.gallery);
mGallery.setSelection(1);

然后继续你的正常工作:)

then continue with your normal work :)

这篇关于画廊的观点并没有从左边开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆