2016-12-21 2 views
0

イメージをキャプチャするボタンとキャプチャしたイメージを表示するイメージビューを持つViewPagerアイテムがあります。キャプチャされた画像を同じビューページの項目に表示することは可能ですか?キャプチャされたイメージをビューページの対応するイメージビューに表示

これは私のビューページです。

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:card_view="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/card_main" 
     layout_height="wrap_content" 
     layout_width="wrap_content" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     card_view:contentPadding="10dp"> 

     <RelativeLayout 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 

      <CheckBox 
       android:id="@+id/check_item" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" 
       android:layout_alignParentTop="true" 
       android:checked="false" 
       android:text="New CheckBox" /> 

      <EditText 
       android:layout_width="fill_parent" 
       android:layout_height="150dp" 
       android:id="@+id/editText_comments" 
       android:hint="Comments" 
       android:gravity="top|left" 
       android:padding="5dp" 
       android:layout_marginTop="5dp" 
       android:background="@drawable/edittext_modified" 
       android:layout_below="@+id/check_item" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" /> 

      <Button 
       style="?android:attr/buttonStyleSmall" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Add Image" 
       android:id="@+id/button_addImage" 
       android:layout_below="@+id/editText_comments" 
       android:layout_centerHorizontal="true" /> 

      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/imageView_preview" 
       android:layout_below="@+id/button_addImage" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" /> 

      <Button 
       style="?android:attr/buttonStyleSmall" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Previous" 
       android:id="@+id/button_previous" 
       android:layout_below="@+id/editText_comments" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" /> 

      <ImageView 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_margin="3dp" 
       android:id="@+id/imageView_preview2" 
       android:layout_below="@+id/button_addImage" 
       android:layout_alignParentRight="true" 
       android:layout_alignParentEnd="true" /> 

      <Button 
       style="?android:attr/buttonStyleSmall" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Next" 
       android:id="@+id/button_next" 
       android:layout_above="@+id/imageView_preview2" 
       android:layout_alignRight="@+id/imageView_preview2" 
       android:layout_alignEnd="@+id/imageView_preview2" /> 

     </RelativeLayout> 
    </android.support.v7.widget.CardView> 

</RelativeLayout> 
+0

あなたが持っているものと達成する必要があるものの画面を追加することができます。 – Galya

答えて

0

ファイルまたはパスからPicassoライブラリを使用して画像を表示します。

Picasso.with(context).load("image path").into(imageView); 
関連する問題