먼저 렌더링을보십시오
실제로이 효과를 달성하는 것은 매우 간단합니다. drawable and drawablev21 의 두 폴더를 나누십시오.
일반적으로 선택기 :
<? xml version = "1.0"alcoding = "utf-8"?> <selector xmlns : android = "http://schemas.android.com/apk/res/android"> <Item Android : grawable = "@menu_selected"and state_pressed = "true"/> <awlail :@rowroid : "@and grastable : and and rastable :"@menu a min.
v21의 선택기 :
<? xml version = "1.0"alcoding = "utf-8"?> <ripple xmlns : android = "http://schemas.android.com/apk/res/android"android : color = "@color/menu_selected"> <!-color of press-> <!-컬러/bitmap- <ailt and el@regl ""<ailt 및 regroid ". />-> < /ripple>
여기에서 ripple 의 color 은 압축 된 물 잔물결 색상이며 item 추가하면이 item 배경이됩니다.
투명한 item 배경으로 추가하지 마십시오 . 하나는 의미가없고 다른 하나는 압박 효과를 표시 할 수 없다는 것입니다.
위는이 기사의 전체 내용입니다. 이 기사의 내용이 Android 개발의 모든 사람들에게 도움이되기를 바랍니다.