0
私はナビゲーションドロワー付きのAndroidアプリを開発中です。私はHomeFragment.xml
でFrameLayoutを使用しています。フレームレイアウト内では、3つのテキストビューを使用して縦横に整列させて、すべての画面サイズで整列が機能するようにしたいと考えています。誰にでもこれを助けることができますか?FrameLayout内にTextViewを整列する
<FrameLayout 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"
tools:context="com.example.mgdetector.HomeFragment">
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/absolute_strength"
android:layout_marginTop="50dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textStyle="bold"
android:textSize="@dimen/textsize"
/>
<TextView
android:text=""
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/current_location_latitude"
android:layout_marginTop="150dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textStyle="bold"
android:textSize="@dimen/textsize"
/>
<TextView
android:text=""
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/current_location_longitude"
android:layout_marginTop="250dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textStyle="bold"
android:textSize="@dimen/textsize"
/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:id="@+id/stopButton"
android:text="WARNING"
android:visibility="gone"
/>
現在、私は
android:layout_marginTop="250dp" // with a difference of 100dp for TextView
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
を使用していますが、私は、これは別の携帯電話の画面サイズのために働くべきかわかりません。