2013-04-23 71 views
1

在頂部我有本地車牌圖像與編輯文本里面。如何在兩張圖像之間輕掃並切換?

我需要向左或向右滑動並將本地車牌圖像切換到全局車牌(新)圖像以輸入較少限制的值。

下面的所有其他信息應該保持不動。

請推薦我怎麼能在Android中做到這一點?

+0

https://github.com/chrisbanes/PhotoView中。檢查照片查看 – Raghunandan 2013-04-23 08:45:07

+1

看到這個。 http://stackoverflow.com/questions/14832947/how-to-switch-the-image-one-by-one-through-left-swipe-or-right-in-android/14833215#14833215 – Shadow 2013-04-23 10:28:13

+0

我有嘗試查看傳呼機,並與圖像工作正常。但我不能在佈局之間切換,因爲我需要圖像和2個EditText裏面。 https://github.com/chiuki/android-swipe-image-viewer – Ragaisis 2013-04-23 12:43:04

回答

0

使用ViewSwitcher

<RelativeLayout 
android:background="#0000FF" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" > 

<ImageView 
     android:id="@+id/img1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
     android:src="@drawable/smile" /> 


<TextView 
    android:text="Loading..." 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content" 
    android:textSize="20dp" 
    android:textColor="#FFFFFF" 
    android:layout_centerHorizontal="true" 
    android:layout_below="@+id/progressbar" /> 

</RelativeLayout> 

<RelativeLayout 
android:background="#FFFF00" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" > 

<TextView 
     android:text="Finished!" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" 
     android:textSize="20dp" 
     android:textColor="#000000" 
     android:layout_marginTop="10dp" 
     android:layout_centerHorizontal="true" /> 

<ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/img1" 
     android:layout_centerHorizontal="true" 
     android:layout_marginTop="50dp" 
     android:src="@drawable/smile" /> 

</RelativeLayout>