I would like to add an XML Layout
as drawable image
for GalleryView
. Is it possible? here is the scenario, I'm having one Layout
in my application. I would like to use images for my gallery, those images exactly looking like the XML layout
(but background and some other views color will be different). So instead of creating multiple images for gallery, I want to use these xml layout as drawables
in Gallery view. Is it possible,? If so how to do that? please help me out friends.
See i have create XML like this
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/always_over" android:state_enabled="false"/>
<item android:drawable="@drawable/always_over" android:state_enabled="true" android:state_pressed="true"/>
<item android:drawable="@drawable/always_over" android:state_enabled="true" android:state_focused="true"/>
<item android:drawable="@drawable/always" android:state_enabled="true"/>
</selector>
And then set in Button
<Button
android:id="@+id/btnAlways"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/always_xml" />
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