android - The background distortion when the screen turn from vertical to horizontal? -


In my piece, I set the background to relative_out .

But when the screen leads to horizontal (portrait) from the vertical (portrait), the background image looks like a distorted.

It can not set relative type to scale type .

Can background scans the background auto rotating horizontally on screen?

(screen size detection is not required, just give background to image auto-scaling and no distortion)

Thanks advance!

A image-view your relative layout Inside and use it as a background, like:

  Android: relative_loutout Android: layout_width = "match_parent" Android: layout_height = "match_parent" & gt; & Lt; ImageView Android: Android: Android: Android: layout_width = "match_perrent" Android: layout_heck = "match_perrent" Android: scaleType = "CentCop" Android: src = "@drawable / my_bug_image" & gt; & Lt; / RelativeLayout & gt;   

In this way you can put other views on your BG and it will scale properly.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -