2013. 11. 15. 10:50

Background gradient




Create a Layout with a Drawable Gradient background and inside that your real layout.

For example, create mygrandientbg_xml in drawables dir like:

<shape android:shape="rectangle" xmlns...">
 <gradient
     android:startColor="#255779"
     android:centerColor="#3e7492"
     android:endColor="#a6c0cd"
     android:angle="90" />
</shape>

Then create a FrameLayout like that

<FrameLayout
  ....
  android:background="@drawable/mygrandientbg"
  android:padding=20dip
 >
 put you layout here and set it to "centered"