やあ、
画面サイズに依存しないレイアウトを設計しようとしています。実際に、画面の中央に大きなサイズの追加があるサンプル レイアウトを設計しています。上部残域と下部残部の中央にテキストがあります。xml は次のとおりです。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/ads_layout_large"
android:layout_width="300dp"
android:layout_height="250dp"
android:layout_centerInParent="true"
android:background="@android:color/background_light" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/ads_layout_large"
android:background="#fff000"
android:gravity="center"
android:text="@string/exit_enjoyed_text" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/ads_layout_large"
android:background="#fff000"
android:gravity="center"
android:text="@string/exit_enjoyed_text" />
</RelativeLayout>
問題は、上部で作業していて、テキストが残りの領域のちょうど中央にあるのに、下部TextView
が画面の半分を覆っていることです。間違いを見つけるのを手伝ってもらえますか? または、同じものを設計する他の方法はありますか?