开发者

How to set images at the ends of Gallery view(right and left)

I need help on placing images(back and forward images) at two ends of my gallery view. I have a gallery to list menus to scroll horizontally, and this gallery is in RelativeLayout how can I get the images at two ends of the gallery without scrollin开发者_Go百科g.

Thanks in advance.


I would modify Praveen's answer a bit:

<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 is very important here.


answer is in your question itself. put to imageview on both sides. the sample layout looks like below

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

Hope it helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜