交换意见ViewFlipper意见、ViewFlipper

2023-09-05 08:34:25 作者:万能青年

有没有一种方法来切换视图在ViewFlipper就像在主屏幕上,在那里我们有小点在屏幕的底部和点击他们,我们可以切换视图。

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 views.

谢谢, 法哈

推荐答案

步骤#1:以点创建图形

Step #1: Create a graphic with a dot

第二步:通过的ImageView把该图形的副本在你的 ViewFlipper 视图窗口小部件,然而,对于你想多点

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

第三步:添加一个 OnClickListener 每个的ImageView 控件

Step #3: Add an OnClickListener to each ImageView widget

第四步:在的onClick(),切换 ViewFlipper 根据需要

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