2017-08-11 31 views
-1

我想知道當我使用此屬性它不會加載指定的圖像或它甚至不工作! android:scr =「@ drawable/bac」 但是,當我使用背景屬性加載圖像時工作正常。 下面是代碼!希望得到一些幫助!android:scr屬性不顯示圖像

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:scr= "@drawable/bac" // This line does not work 
    android:background="@drawable/bac" 
    /> 

回答

4

兩件事。

一:您可以使用

android:scr= "@drawable/bac" 

屬性是SRC,像這樣:

android:src= "@drawable/bac" 

二:在這種情況下的問題是,因爲SRC是屬性,但ImageView的屬性。 TextView沒有src屬性。

+0

非常感謝我的問題解決!真的很感謝,這是幾個星期的第一次我打錯了名字現在它明確:P –