Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Can not resolve image size

$
0
0

Hi, i'm trying to center an image in a relative layout but i'm failing at it because the size can not be resolved.
When I debug this line
return (parent.Width * .5) + (imagenLogo.Width * .5);
I get that imagenLogo.Width=-1 wich is wrong.
The image is being load correctly becuase I can see it in the screen (just not in the place of the screen that I want).
For creating the image i'm using

        var imagenLogo = new Image()
                {
                    Aspect = Aspect.AspectFill,
                    Source = new FileImageSource() { File = "Logo.png" }
                };

What I am doing wrong?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>