我有應該在佈局背景(全屏)上安裝的jpeg圖像。我想我應該測量設備屏幕的高度和寬度,並放大我的圖片。我在嘗試使用xml中的中心裁剪圖片時也遇到了onClick凍結。任何建議將不勝感激。安裝背景圖像的最佳做法
這裏是我的佈局:
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/AppTheme.Dark"
android:background="#1B1B21">
<ImageView
android:id="@+id/above_mountains"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/above_mountains"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingTop="48dp"
android:paddingRight="16dp"
android:paddingLeft="16dp"
android:paddingBottom="16dp">
...ACTUAL LAYOUT HERE...
</LinearLayout>
</FrameLayout>
你試過'機器人:背景= 「@繪製/ your_image.jpg」'你的佈局? – miljon
所以你想知道'如何在應用程序的背景上安裝jpeg'和'如何在嘗試裁剪圖片時防止點擊凍結'?如果是的話,你需要發佈你的代碼第二個。問題不清楚順便說一句,你需要澄清它。 –
我添加了我的佈局。我需要縮放與裁剪和不凍結。 – Daimonium