幫助理解請。 我需要在特定的框中顯示。 我不喜歡這樣寫道:TextView在不同的顯示器上
<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"
android:background="@drawable/fon"
tools:context=".MainActivity" >
....
<TextView
android:id="@+id/textView3"
android:layout_width="200dp"
android:layout_height="210dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:includeFontPadding="false"
android:lineSpacingMultiplier="0.8"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="20sp" />
....
</RelativeLayout>
一切工作在四個英寸屏幕很好,但如果有一個大對角,這將是糟糕的。
隨着屏幕的增加,textView的大小不會改變。
我使用「dp」和「sp」,而不是靜態「px」,但不起作用... 爲什麼會發生這種情況?
截圖:
嘗試使用浸漬(顯示獨立的像素)。 – fedorSmirnov