0

ギャラリー ビューの両端に画像 (前後の画像) を配置する方法を教えてください。水平方向にスクロールするメニューをリストするギャラリーがあり、このギャラリーは RelativeLayout にあり、スクロールせずにギャラリーの両端にある画像を取得するにはどうすればよいですか。

前もって感謝します。

4

2 に答える 2

3

Praveenの答えを少し変更します:

<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal">
    <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" />
    <Gallery android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1"/>
    <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>

android:layout_weight="1" in はここで非常に重要です。

于 2010-08-23T12:21:22.123 に答える
1

答えはあなたの質問そのものにあります。imageview両側に置きます。サンプルレイアウトは次のようになります

<LinearLayout>
    <ImageView....../>
    <Gallery .../>
    <ImageView .../>
</LinearLayout>

それが役に立てば幸い。

于 2010-08-23T12:10:02.660 に答える