Skip to content

Instantly share code, notes, and snippets.

@zaki50
Created February 22, 2014 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zaki50/9150791 to your computer and use it in GitHub Desktop.
Save zaki50/9150791 to your computer and use it in GitHub Desktop.
パネルの背景画像用の drawable リソースとして、上端にハイライト、下端にシャドウをいれたものを作る例。色を変えやすいように基本部分は shape を使う。ハイライトとシャドウはshapeでは作れないので、半透明な9patch画像を用意する。xxhdpi用だとこんな感じ https://dl.dropboxusercontent.com/u/713512/highlight_and_shadow.9.png
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="rectangle">
<solid android:color="#ffcccccc"/>
</shape>
</item>
<item android:drawable="@drawable/highlight_and_shadow"/>
</layer-list>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment