Android tip #027 – Add shadow to labels, buttons and other views

Platform/Language: Java/XML/Android

Description: We can drop shadows to our controls (TextView, Buttons, Checkbox, …). Adding this shadow, we can create a better interface in our applications (but be careful adding shadow to everything!).

Result

Code:

my_layout.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!-- ... -->
<TextView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
 
  android:textColor="@android:color/black"
  android:text="@string/eridemNet"
 
  android:shadowRadius="3"
  android:shadowDx="3"
  android:shadowDy="2"
  android:shadowColor="@android:color/black"
></TextView>
<!-- ... -->

2 Responses To  “Android tip #027 – Add shadow to labels, buttons and other views”
Leave A Reply