开发者

custom border frame for GalleryView

开发者 https://www.devze.com 2023-04-04 19:21 出处:网络
I have created t开发者_StackOverflowhe Gallery view. but i want the border around the currently selected Gallery item can you anyone help me for this

I have created t开发者_StackOverflowhe Gallery view. but i want the border around the currently selected Gallery item can you anyone help me for this

Thanks Raj.


custom border frame for GalleryView

Create a border/frame background something like this, use 9-patch tool for the same and then set this as the background of GalleryView or GridView item.


Create a an xml file in drawable folder like below

gallery_back.xml

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

Now set this gallery_back.xml as background of your gallery item. thats all

0

精彩评论

暂无评论...
验证码 换一张
取 消