Skip to Content

how to define a header in sap UI5 so image is not streched/compressed

hi ,

When I declared an image in the header, the image was compressed. I modified CSS to look it good. But now when i run same app in ios phone, image looks streched. How to modify it to look good on all screen sizes. This is a mobile app.

Thanks,

Sangeeta

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Jul 20, 2015 at 11:59 AM

    Hi Sangeeta,

    Which measure unit did you use for CSS Image width, is it in "px" or "%"?

    If you're using "px" please change it to "%". Since, different platforms like mobile/tablet/desktop will have different screen pixels. You can check in the console -

    window.screen.availWidth
    

    So, better use "%" like below -

    var oImage = new sap.m.Image({src:"image", width:"20%"});
    

    Regards,

    Sai Vellanki

    Add comment
    10|10000 characters needed characters exceeded