画廊的观点并没有从左边开始并没有、画廊、观点

2023-09-07 11:31:08 作者:独揽帅氕

我使用的库这样

<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 :)