0

Hi I am using the gallery for displaying images. But the gallery has an end. I don't want this behaviour; I want to repeat the images again and again on both sides of the gallery. Is there a way to display the gallery elements as a circle?

4

1 に答える 1

4

円形のギャラリーを作成する方法に関するチュートリアルを書きました。ここの私のブログ投稿でそれを読んでください: http://evgeni-shafran.blogspot.com/2011/08/tutorial-custom-gallery-circular-and.html

これが私がしたことです:

私が使用したアダプタでは、要素数が非常に多いと彼に思わせました。そして、各要素の位置=位置%要素.長さ、そして私は真ん中に最初の位置を作りました。

何が起こるかは次のとおりです: (3 つの要素に対して実行します。後で好きな量を取得できます) これは、アダプターが要素を認識する方法です。

1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1, 2,3,1,2,3,1,2,3,1,2,3,1,2,3

次に、最初の要素が真ん中にあることを彼に伝えます。

1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,-> 1 <-,2,3,1,2, 3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3

非常に大きな数にすると、ユーザーは最後までスクロールすることができます。

お役に立てば幸いです。

于 2011-08-02T05:19:46.000 に答える