tags:

views:

44

answers:

1

Hi,

I have the following linear layout. What I don't understand is if I set the background to another image, the padding information are reset. Is there a way to prevent this?

<LinearLayout android:id="@+id/aPanel"
    android:orientation="horizontal" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:background="@drawable/bkground"
    android:paddingLeft="15dp" android:paddingRight="15dp"> 

     <!-- some children here -->
     </LinearLayout>

I see the position of the children get shifted when I change the backround drawable of the linearlayout 'aPanel'.

A: 

This shouldn't happen. But, you can use the "hierarchyviewer" tool located in the Android SDK tools directory to help you checkout any layout issues that you have.

charlie hwang