I tried to make a custom LinearLayout and Button styles.
I'm just wondering where to place my Selector xml files?
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:angle="90"
android:startColor="#534E4E"
android:endColor="#000000"
android:type="linear" />
</shape>
</item>
In my mono project I put the files at drawable folder BUT in my Java(native) development I don't know maybe I miss the basic in storing files but still have no Idea where to put my Selector since the latest Eclipse plugin has 4 drawables (-ldpi,-hdpi, mdpi and xhdpi).
Deciphering the Styles file Fire up Android Studio and search for values. xml and select the one contained inside the appcompat-support library.
A selector can be an xml file created inside the drawable folder. Selector for different background colors. The following selector file btn_bg_selector. xml contains the code for setting different background colors on a button for different states.
Right Click on Drawable folder -> New -> Drawable Resource File , will create a XML file inside the Drawable folder.
Select layouts , right-click and select New → Folder → Res Folder. This resource folder will represent a “feature category” that you want. You can easily create any type of file/folder in Android Studio.
Create a drawable/ folder in the res/ directory and add the selector.xml files in there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With