开发者

Newbie: gallery show only one image each time

I have followed the android gallery tutorial to build a simple gallery which is exactly the same as the tutorial's.

Now, I would like to improve the gallery from the tutorial to show only one image at one time(in the tutorial, several images are showing at once), that's only show one image which occupy the whole gallery area.

Then, only finger touch and move the current image to left or right will make the neighboring next(left or right) image to be shown.

How should开发者_C百科 I modify the tutorial's code? any suggestions?


You could make the Image the same size as the screen:

i.setLayoutParams(new Gallery.LayoutParams(Gallery.LayoutParams.FILL_PARENT, Gallery.LayoutParams.FILL_PARENT));
i.setScaleType(ImageView.ScaleType.FIT_XY);


This thread might be useful

Android GalleryView Problem

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜