2011-07-23 14 views
1

GridViewギャラリーの画像サムネイルを作成しました。選択したサムネイルを次の画面(フルスクリーン)でフルサイズで表示します。Androidのフリッパーは反転しません

私はフルサイズの画像を持っていますので、サイズを変更する必要はありませんが、フリッパーが反転しないという問題があります。

マイonItemSelected方法は次のようになります。

public void onItemSelected(AdapterView<?> adapterView, 
     View view, int i, long l) { 

    if (gridLayout.isActivated()) { 
     fullImage.setImageBitmap(
      downloadImage(listOfImages.get(i).getImgURLs()[1].getUrl())); 
     flipper.showNext(); 
    } 
} 

と、このようなmain.xml:

<?xml version="1.0" encoding="utf-8"?> 
     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/lLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> 
    <ViewFlipper android:id="@+id/details" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/gridLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> 
    <GridView xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/gridView" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:columnWidth="90dp" 
     android:numColumns="auto_fit" 
     android:verticalSpacing="10dp" 
     android:horizontalSpacing="10dp" 
     android:stretchMode="columnWidth" 
     android:gravity="center" /> 
     </LinearLayout> 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/oneImageLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> 
     <Button android:id="@+id/flipMeBack" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="Flip Me!" 
      /> 
     <ImageView android:id="@+id/wholeImage" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
     /> </LinearLayout> 
    </ViewFlipper> 
</LinearLayout> 

答えて

0

フリッパーのためのあなたのコードは多分問題がどこか別の場所で、私には大丈夫に見えます。 これを試して、動作するかどうか確認してください。

flipper.setDisplayedChild(1);

何も問題がなければ、フリッパーの代わりにビュースイッチャーを使用してみてください。

+0

でも動作しません。私は本当に別のアクティビティを使用しないで、アプリに追加していないものやフリッパーに何かがあるのでしょうか?とにかく私の場合にフリッパーを使用するのは正しいですか? – user854787

+0

x、Use-- System.out.println(x); x ++;すべての文の後に、何が呼び出され、何が呼び出されていないのかを把握するために、logcatを見ると、xの値がそこに表示されます。 ここに結果を投稿してください。 – Arveen

+0

私はあなたが返事をしているのを見ていませんでしたので、私はビュースイッチャーを使用することに決めました。(これは私がフリッパーとして初めて使用します)、新しいアクティビティにビットマップを渡すために私が何をするか教えてください。 2番目のアクティビティで表示したい画像。私はインターネット上で、2つのパラメータを受け取るインテントを使用する例を見つけました。その1つは新しいアクティビティです。ビットマップを渡す方法は、最初のパラメータ(ビットマップインスタンス以外はできないため)です。 – user854787

関連する問題