나는 다음과 같은 것을 가지고있다. LinearLayout
. 내가 이해할 수없는 것은 배경을 다른 이미지로 설정하면 패딩 정보가 재설정된다는 것입니다. 이것을 막을 수있는 방법이 있습니까?배경을 변경해도 LinearLayout의 패딩이 변경됩니까?
<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>
나는 내가 LinearLayout
aPanel의 배경 드로어 블을 변경할 때 아이의 위치가 이동 얻을 참조하십시오.
"패딩 정보가 리셋된다"고 귀하의 증거는 무엇인가? 즉, 실제 증상은 무엇입니까? – CommonsWare
http://stackoverflow.com/questions/5890379/android-setbackgroundresource-discards-my-xml-layout-attributes와 동일한 문제 - setBackgroundResource()가 호출 된 후 패딩이 단순히 재설정되는 경우 (가능하면 9 패치 배경에만 관련됨)). –