Leem
Leem

Reputation: 18308

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 I modify the tutorial's code? any suggestions?

Upvotes: 2

Views: 3710

Answers (2)

MGK
MGK

Reputation: 7098

This thread might be useful

Android GalleryView Problem

Upvotes: 0

tdtje
tdtje

Reputation: 190

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

Upvotes: 2

Related Questions