0

レイアウトをそのように見せようとしています。グリッドビューやテーブルレイアウトなどを試しましたが、正しく表示されません。こんなものが欲しいです。

ImageButton ImageButton2

ImageButton3 ImageButton4

    ImageView1

ImageButton5 ImageButton6

ImageButton6 ImageButton7 ImageButton8(これらは小さいアイコンです)

   ImageButton9 (small donate button)

レイアウトを画像ボタンで機能させる方法がわからないようです。どのレイアウトを使用する必要がありますか?そして、可能であれば、xmlレイアウトのサンプルコードを投稿できますか?

4

2 に答える 2

0

あなたはこのようなことをすることができますが、それを行う別の方法があるかもしれません:

<?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"
    >

  <LinearLayout android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <ImageButton android:src="@drawable/icon" android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
    <ImageButton android:src="@drawable/icon" android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
  </LinearLayout>

  <ImageView android:layout_width="wrap_content" android:src="@drawable/icon"
    android:layout_height="wrap_content" android:layout_gravity="center"/>

  <LinearLayout android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <ImageButton  android:src="@drawable/icon" android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
    <ImageButton  android:src="@drawable/icon" android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
  </LinearLayout>

  <LinearLayout android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <ImageButton  android:src="@drawable/icon" android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
    <ImageButton  android:src="@drawable/icon" android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
    <ImageButton  android:src="@drawable/icon" android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
  </LinearLayout>

  <ImageView android:layout_gravity="center"  android:src="@drawable/icon" android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
</LinearLayout>

これが結果です。私はAndroidプロジェクトをまとめて、アイコンのデフォルトの画像を使用しました。

代替テキスト

于 2010-08-09T15:11:35.067 に答える
-1

多分これはあなたを助けることができます:

DroidDraw -Androidでプログラミングするためのユーザーインターフェイス(UI)デザイナー/エディター

グラフィカルエディタを使用してレイアウトを作成し、XMLを生成できます。

于 2010-08-09T15:10:50.993 に答える