문제

I currently have a code for a button in XML as such:

<Button
    android:id="@+id/button1"
    android:layout_width="250dp"
    android:layout_height="62dp"
    android:layout_gravity="center_horizontal"
    android:drawableLeft="@drawable/ic_menu_slideshow"
    android:text="Start Slideshow" />

However, I get an error for Error: No resource found that matches the given name (at 'drawableLeft' with value '@drawable/ic_menu_slideshow'). However, when I check on the graphical layout of the XML file, the stock drawable at ic_menu_slideshow is present. Why do I get this compilation error, and how would I fix it?

도움이 되었습니까?

해결책

Try to replace @drawable/ic_menu_slideshow with @android:drawable/ic_menu_slideshow

다른 팁

Have you tried cleaning your project? A similar question was asked moments ago so keep an eye on that as well: Can't Resolve Android Resource Strings

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top