0

サンプル プロジェクトに取り組んでおり、Universal Image Loader を使用しています。UIL は素晴らしいですが、何かを変更したいのですが、次へ/前へのようなボタンをギャラリーに配置したいだけです。

しかし、ギャラリーに自分のボタン ビューが表示されません。

XML レイアウトは次のとおりです。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Gallery Demo"
    android:id="@+id/txt"
    />
    <Gallery
    android:id="@+id/gallery"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center_horizontal"
    android:spacing="100px"
    android:scrollbars="horizontal"
    android:scrollbarFadeDuration="0"
    android:scrollX="100px"
    />
    <LinearLayout
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="horizontal"
     android:layout_marginTop="5px"
     >
     <Button
     android:text="Previous"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:id="@+id/btnPrev"
     android:onClick="onClick"
      />
      <Button
     android:text="Next"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:id="@+id/btnNext"
     android:onClick="onClick"
      />

    </LinearLayout> 

</LinearLayout>

ギャラリー ビューが画面全体に表示されているようです。それを行う方法についてのアイデアはありますか?

4

1 に答える 1

0

あなたの ImagePagerAdapter extends BaseAdapter imageview android:layout_widthと をandroid:layout_height確認してFill_parentください。wrap_content.

wrap_content画像が大きい場合は、フルスクリーンで表示されます。

ありがとう

于 2013-01-01T16:51:32.827 に答える