I have a simple layout as follows :
The solution posted by @Mehmet Katircioglu works well, but you can solve the problem simply changing the android:layout_margin to android:padding, without none extra view. Like this: