Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top