我想設置像背景圖像的圖像中的佈局(通過XML或代碼)問題與佈局的背景圖像
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_layout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/my_image">
或
View myLayout= findViewById(R.id.main_layout);
myLayout.setBackgroundResource(R.drawable.my_image);
我的問題是比Android修復全背景屏幕中的圖像,調整大小和修改圖像比例。
如何設置圖像,並且圖像僅佔用了必要的空間? (沒有圖像大小調整)
如果你設置了android:layout_width =「fill_parent」,android:layout_height =「fill_parent」也是你的背景「fill_parent」 – carlovv 2011-03-29 10:33:22