Make carousel with ViewFlipper or ViewPager

后端 未结 3 1497
挽巷
挽巷 2021-02-02 02:53

Since GalleryView deprecated we should immigrate to some alternative widgets, In my case ViewFlipper is the best but I have faced with several issues,

3条回答
  •  深忆病人
    2021-02-02 03:10

    Ok, here's one thing you can do:

    1. Use a horizontal list view solution (example here)

    2. Make sure each item takes about 1/3 of the width of the screen. Maybe a bit more.

    3. For the stickiness of the center item, handle touch events so that it will smooth scroll to the middle item, for example as shown on samsung's sample "circle launcher" .

    4. For more fancy effects, make the size/location properties of the views change similar to the sample i've written about on #3 .

提交回复
热议问题