3

ギャラリー ウィジェットにスライドする 1 ~ 10 個の画像が含まれています。画面をストライプすると、画像が左から右にスクロールすることがわかっています。10 後に最初の画像で自動的に開始する自動円形ギャラリーが必要です。自動円形アダプターまたは方法はありますか ???

         final Gallery g = (Gallery) findViewById(R.id.gallery);
         g.setAdapter(new ImageAdapter(this));
         Animation animation = AnimationUtils.loadAnimation(this,
        R.anim.rotate_indefinitely);

        animation.getInterpolator();
        animation.setDuration(1000);
        animation.setStartOffset(200);
        animation.setRepeatMode(2);
        animation.setFillAfter(false);
        animation.setFillEnabled(true);

        g.setAnimation(animation);
        g.startAnimation(animation);

しかし、私は最初の画像がアニメーション化されているのを見るだけです..

私のビデオを見てください...

4

2 に答える 2

8

getCount() メソッドで Integer.MAX_VALUE を返す Gallery の SpinnerAdapter を記述します。次に、getDropDownView() および getView() で View を返すときに、実際の項目数のモジュロをposition引数に適用します。

于 2010-06-25T09:38:40.310 に答える
1

最も簡単な解決策を実装しました。これだけreturns Integer.MAX_VALUE in it's getCount() method で右側に無限プールができます。両面 pass Integer.MAX_VALUE/2 in the position of child in setSelection(position, animate) クールにするために。

于 2011-11-14T12:47:23.380 に答える