Json
Json

Reputation: 1

How to modify the default button state in Android Studio using selector tag?

android studio show me: element selector must be declared,why?

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/rd_btn_press"
        android:state_pressed="true" />
    <item android:drawable="@drawable/rd_btn"
        android:state_focused="true" />
    <item android:drawable="@drawable/rd_btn" />
</selector>

Upvotes: 0

Views: 716

Answers (1)

Shobhit Puri
Shobhit Puri

Reputation: 26007

Make sure you have this file in the res/drawable folder. It seems to me that you have it in some other folder in android project. Please comment if that's not the case.

Upvotes: 1

Related Questions