2013-04-16 61 views
0

如何製作包含兩部分的Android圖像滑塊。一部分是水平圖像滑塊(thumnail),第二部分是所選圖像的原始圖像。 這個樣子IOS水平視圖在IOS: enter image description here像Ios的Android圖像滑塊

回答

1

您需要使用GalleryImageView

1:做一個佈局:

<LinearLayout 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 

    <ImageView 
    android:layout_width="fill_parent" 
    android:layout_height="0dp" 
    android:layout_weight="70"/> 

    <Gallery 
    android:layout_width="fill_parent" 
    android:layout_height="0dp" 
    android:layout_weight="30"/> 

</LinearLayout> 

2:初始化畫廊與適配器。

3:爲圖庫項目定義onItemClickListener,您需要更改上面給出的imageView。

或者,你可以使用這裏給出的完整代碼: LINK(類似於您正在嘗試做的)