3
當我將9.PNG圖像設置爲RelativeLayout
的背景時,它內部的所有元素都縮小到中間。這裏是XML和快照。爲什麼RelativeLayour中的九貼圖隱藏了所有內部元素?
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Just a simple white text which does not show up"
android:textColor="#ffffff"
/>
</RelativeLayout>
如果更改背景顏色或正常的圖像,我得到的文本。
android:background="@drawable/bg2" //normal image
誰能解釋爲什麼會出現這種情況?
你的問題的明確答案在這裏提供:http://stackoverflow.com/questions/3904852/android-layout-broken-with-9-patch-background –