0
我試圖設置爲在drawable
文件夾中設置此圖片soccer_field
。當我查看「圖形佈局」它顯示的背景,但是當我在我的設備上運行它,它不是..設置圖片作爲Android的活動的背景
<LinearLayout 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/soccer_field"
android:orientation="horizontal">
</LinearLayout>
爲什麼會出現這種情況,如何解決呢?
我試圖把我的照片中的所有文件夾繪製的,它仍然沒有工作! –
如果在'drawable - ?? dpi'文件夾中找不到它,默認情況下它會查找'drawable',這是OP所說的位置。 – Geobits
好,很難。 'soccer_field'是一個PNG文件?你在代碼中使用佈局做些什麼?如果設備上顯示任何內容,您是否可以嘗試使用虛擬文本添加文本視圖? – jboi