因此,我有一個屏幕分爲2.在屏幕的上半部分,我有一個圖像,在其下半部分,我有一個文本。無論如何,我都無法正確地填充屏幕。它始終以圖像頂部或側面的空白區域結束(如下圖所示):Blank sides,Blank top。如果有人能幫我解決這個問題,我會很感激。如何將圖像設置爲strecth並填充屏幕? (屏幕被劃入2)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/flag"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
/>
<TextView
android:id="@+id/population"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
/>
</LinearLayout>
我試圖使用它對齊和重力沒有成功。我沒有使用scaleType。 –
你可以發佈你的佈局的代碼? – LordRaydenMK
我編輯了帖子併發布了佈局的代碼,先生。 –