简体   繁体   中英

Nine patch drawable not working in tabhost landscape orientation

So I created my image as nine patch drawable as tab widget for tabhost. It looks right when in portrait mode but when in landscape mode, the nine patch drawable didn't expand. It has just the same size just like in the portrait mode. Can anyone help me? Thanks.

Found out the answer. Instead of setting the nine patch drawable as source like this

android:src="@drawable/tab_one"

I tried to change it to background. Now, the nine patch drawable fits the sreen whether in portrait or landscape mode.

android:background="@drawable/tab_one"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM