scaling - Android - setScaleX/Y makes image clipped -


i have banner @ bottom of screen, , use setscalex + setscaley zoom fit screen width.

before , after:

before after

the main different that, bottom part of image clipped after scaling (you can see bottom part of white horn in banner cut)

below code (adview banner dimension 320x50)

displaymetrics metrics = new displaymetrics();             getwindowmanager().getdefaultdisplay().getmetrics(metrics);             float scale = metrics.widthpixels / metrics.density / 320;             adview.setscalex(scale);             adview.setscaley(scale); 

any solution? thanks!

p.s. may suggest using smart banner adsize of adview. however, can't use smart banner reasons can play setscalex/y trick.

set adsize smart_banner , layout_width match_parent

change in xml

android:layout_width="match_parent" android:layout_height="wrap_content" ads:adsize="smart_banner"     

Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -