본문 바로가기
프로그래밍 놀이터/안드로이드, Java

[android] Shadow effect with custom shapes

by 돼지왕 왕돼지 2015. 12. 3.
반응형


 [android] Shadow effect with custom shapes


출처 : https://slothdevelopers.wordpress.com/2014/05/22/shadow-effect-with-custom-shapes/


Android, Bottom, COLOR, Corner, custom button, custom shape, custom 버튼, Example, ITEM, layer-list, Left, Radius, Right, sample, selector, Shadow, shadow effect, Shape, Solid, state_pressed, Top, xml, [android] Shadow effect with custom shapes, 안드로이드


Custom 한 버튼을 만드는 xml 정의이다.


Custom 한 Shadow 와 Custom 한 버튼 모양을 만들기에 좋다.



Android, Bottom, COLOR, Corner, custom button, custom shape, custom 버튼, Example, ITEM, layer-list, Left, Radius, Right, sample, selector, Shadow, shadow effect, Shape, Solid, state_pressed, Top, xml, [android] Shadow effect with custom shapes, 안드로이드

<요런 요런>



<?xml version="1.0" encoding="utf-8"?>

 

<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_pressed="true">

        <layer-list>

            <item android:left="4dp" android:top="4dp">

                <shape>

                    <solid android:color="#ff58bb52" />

                    <corners android:radius="30dip"/>

                </shape>

            </item>

        </layer-list>

    </item>

    <item>

        <layer-list>

            <!-- SHADOW LAYER -->

            <item android:left="4dp" android:top="4dp">

                <shape>

                    <solid android:color="#66000000" />

                    <corners android:radius="30dip"/>

                </shape>

            </item>

            <!-- CONTENT LAYER -->

            <item android:bottom="4dp" android:right="4dp">

                <shape>

                    <solid android:color="#ff58bb52" />

                    <corners android:radius="30dip"/>

                </shape>

            </item>

        </layer-list>

    </item>

</selector>






반응형

댓글