と1つのビューを置き換える:ボタンで置き換える(非表示)別と1つのビューをクリックしアンドロイド:私は、一般的に必要なもの、他の
はのは、細部に深く行こう: 私は100枚の画像で構成されていViewPagerを、使用しています。問題なし - 画像
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="1dip"
android:background="#ffffff">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
/>
</RelativeLayout>
それは作品のレイアウト
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="#ffffff" >
</android.support.v4.view.ViewPager>
<ImageButton
android:id="@+id/imagePlay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/imageRight"
android:layout_alignTop="@+id/imageList"
android:src="@drawable/list" />
</RelativeLayout>
ViewPager
のレイアウト。しかし、私は、ビューページにボタンを追加する必要がありますし、ビューの画像をタップした後、gifに変更する必要があります。これはgifのプレビューのように見え、onclickの再生後に表示されます.GIFが再生を開始します。 GIFを用
カスタムレイアウト:それは
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageList"
android:layout_marginRight="28dp"
android:layout_toLeftOf="@+id/imageRight" >
<com.basv.gifmoviewview.widget.GifMovieView
android:id="@+id/gif1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
を解決する必要がありますどのように?ボタンをタップして別のアクティビティを開くのはかなりシンプルですが、問題は同じフラグメントでGIFを再生することです。
アイデアはありますか?
返信ありがとう、私はそれは携帯電話のメモリ使用量のための最良の解決策ではないと思うが、問題を解決するために良いと思う。 – tadvas
編集済みの回答を見る –