开发者

Switching views in ViewFlipper

开发者 https://www.devze.com 2022-12-22 03:19 出处:网络
Is there a way to switch views in a ViewFlipper just like on Home screen, where we have small dots at the bottom of the screen and on clicking on them we can switch vie开发者_Python百科ws.

Is there a way to switch views in a ViewFlipper just like on Home screen, where we have small dots at the bottom of the screen and on clicking on them we can switch vie开发者_Python百科ws.

Thanks, Farha


Step #1: Create a graphic with a dot

Step #2: Put copies of that graphic in the Views of your ViewFlipper via ImageView widgets, for however many dots you want

Step #3: Add an OnClickListener to each ImageView widget

Step #4: In onClick(), switch the ViewFlipper as desired


Actually, there is a better thing these days =) flowview by Patrik Åkerfeldt. See here:

https://github.com/pakerfeldt/android-viewflow

0

精彩评论

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