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

Image.Width always -1?

$
0
0

Hey,

I want to have a label in a frame with the same width as my image but image.width always returns -1?

This is what I tried:

_image.Source = pages[activePage].image.Source;
_frame.Content = pages[activePage].text;
_frame.WidthRequest = _image.WidthRequest;
Console.WriteLine ("Image width: " + _image.Width + "; Frame width requested: " + _frame.WidthRequest + "; Frame width: " + _frame.Width);
//Image width: -1; Frame width requested: -1; Frame width: -1

How can I access the width of a view?


Viewing all articles
Browse latest Browse all 58056

Trending Articles