2012-12-26 56 views
0


我設計了一個畫廊,像這樣Gallery庫實現問題

現在我已經實現了畫廊很不錯。現在的問題是兩個點傳來的圖像的下方。 點的邏輯:所選圖像的黑色點和任何點圖像的選擇應在庫中改變。

+0

見[這裏](https://開頭github.com/JakeWharton/Android-ViewPagerIndicator)它可能會幫助你 – MAC

+0

@MAC:與視圖尋呼機我有更多的問題....與水平滾動..如果我的滾動包含甚至垂直組件的小amt它不能夠滾動但這不在畫廊裏。 –

回答

0

我已經解決了這個問題,像這樣
1)通過在線性佈局中有兩個畫廊,一個用於圖像庫和其他點畫廊來實現這一點。
2),這是多麼我已經集成了兩個

iconGallery = (Gallery) view.findViewById(R.id.product_image_gallery_icon); iconGallery.setVisibility(View.VISIBLE); gallery = (Gallery) view.findViewById(R.id.product_image_gallery); GalleryImageAdapter adapter = new GalleryImageAdapter(getActivity(), urlList); gallery.setAdapter(adapter); gallery.setCallbackDuringFling(false); gallery.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { GalleryIconAdapter galleryIconAdapter= new GalleryIconAdapter(getActivity(), dotCount, position); iconGallery.setAdapter(galleryIconAdapter); } public void onNothingSelected(AdapterView<?> parent) { } });

PLS更新我有人發現一個更好的解決方案。

0

嗨簡單的檢查一樣的邏輯:在屏幕上基於該posiiton

當前項目可見:

if(selectedItem == currentPosition){ 
Then display Black dotted image 
} 
in else 
if position not matched with current item shown in gallery{ 

then default image will be appear... 

} 

我希望它能幫助:)