を取る作る:私がやりたいのは何AndroidのRelativeLayoutは、編集テキストは、私は以下のレイアウト持っているすべてのスペース
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/aussie_bg_big" >
<ImageView
android:id="@+id/titleImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:contentDescription="@null"
android:src="@drawable/aussie_title_small" />
<ImageView
android:id="@+id/clearButtonOutput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/titleImage"
android:layout_alignParentRight="true"
android:contentDescription="@null"
android:src="@drawable/aussie_clear" />
<EditText
android:id="@+id/OutputText"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_above="@+id/clearButtonOutput"
android:layout_alignParentLeft="true"
android:background="@drawable/textbox"
android:ems="10"
android:gravity="top"
android:inputType="textMultiLine"
android:textColor="#ffffff" />
<ImageView
android:id="@+id/translateButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/OutputText"
android:layout_centerHorizontal="true"
android:clickable="true"
android:contentDescription="@null"
android:src="@drawable/translatebuttonselector" />
<ImageView
android:id="@+id/ClearButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/translateButton"
android:layout_alignParentRight="true"
android:contentDescription="@null"
android:src="@drawable/aussie_clear" />
<EditText
android:id="@+id/InputText"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_above="@+id/ClearButton"
android:layout_alignParentLeft="true"
android:background="@drawable/textbox"
android:ems="10"
android:gravity="top"
android:inputType="textMultiLine"
android:singleLine="false"
android:textColor="#ffffff" />
されています:
- >"imageBottom"をキープいつでも活動の底面の画像ビューを水平に中心に。
- >すべての回での活動の中心に"imageCenter" ImageViewのをキープ、は水平にを中心に。
- >右に整列imageCenter、の上方に配置されてのinputTextのEditText以下"imageBelowInputText" ImageViewのを保管してください。
- >右に整列imageCenterとimageBottom、との間に位置しているのOutputTextのEditText以下"imageBelowOutputText" ImageViewのを保管してください。
これまでのところうまくいきましたが、私はedittextビューが残りのスペースをすべて占有するようにしたいと思います。それぞれの編集テキストのサイズをdpiでハードコードしているので、小さな、普通の、大型の、x-largeスクリーン用のさまざまなバージョンのレイアウトを提供してくれました。しかし、いくつかのレイアウトでは、それはやはり少し間違って見えてしまいます(ミスアラインメント)。だからこそ私は最初にImageViewsを配置し、2つのEditTextが残りのスペースをすべてEQUALLY(重要)にするソリューションを探しています。
これまでのところ、私は100%正しい解を考えることができませんでした。あなたは私を助けることができます?ありがとう!
あなたが何をしたいの絵画的表現が –
があなたのxmlレイアウトをリファクタリング...素晴らしいものになるように設定さlayout_weight。レイアウトにどこにも表示されないIDが表示されます( 'clearButtonOutput'?!?!)。 – Luksprog
申し訳ありません。レイアウトを再投稿しました。 –