2016-01-19 35 views
-4

當我從Palette中添加一個ImageView到Android Studio時,程序不會提示我選擇一個像以前一樣的實際圖像。它只是把一個空的ImageView像這樣:Android Studio - 添加一個imageview和源代碼

<ImageView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/imageView2" /> 

這是一個功能或錯誤?因爲每次在Eclipse ADT中這個速度非常快,我都必須手動選擇src,這非常煩人。

僅供參考我的Android Studio版本是1.5.1

+3

拖動成分後,再添加源從屬性。怎麼了? – zIronManBox

+0

因爲我必須向下滾動,找到src屬性,在我的文件夾中手動查找/搜索圖像等。它比Eclipse ADT中的圖像慢5倍。 – breakline

+0

該特性的_lack_是否是一種破壞行爲?如果是的話,你可以將其添加到[工具功能請求](https://code.google.com/p/android/issues/entry?template=Tools%20feature%20request) –

回答

1

你需要寫機器人:SRC = 「@繪製/ ic_pwd」

<ImageView 
        android:id="@+id/imgView" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"  
        android:src="@drawable/ic_pwd" /> 
相關問題