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

Image in Grid is ignoring WidthRequest and HeightRequest since Xamarin Forms 2.0

$
0
0

I have an image inside a Grid on a Listview. Since I updated to Xamarin Forms 2.0 the render is ignoring WidthRequest and HeightRequest

`readonly Label Message = new Label () {
VerticalOptions = LayoutOptions.Center,
Text = "",
FontSize = Device.GetNamedSize(NamedSize.Small,typeof(Label))
};

    readonly Image UserPicture = new Image () {
        BackgroundColor = Color.Transparent,
        HeightRequest = 0,
        WidthRequest = 0,
        Aspect = Aspect.AspectFill,
    };

    readonly CachedImage AlbumPreviewPicture = new CachedImage () {
        WidthRequest = 56,
        HeightRequest = 48,
        DownsampleWidth = 56,
        Aspect = Aspect.AspectFill,
        FadeAnimationEnabled = false,
        TransparencyEnabled = false,
    };`

And my layout is this:

`var grid = new Grid {
Padding = 1,
RowDefinitions = {
new RowDefinition { Height = new GridLength (60, GridUnitType.Absolute) },
},
ColumnDefinitions = {
new ColumnDefinition { Width = new GridLength (46, GridUnitType.Absolute) },
new ColumnDefinition { Width = new GridLength (1, GridUnitType.Star) },
new ColumnDefinition { Width = new GridLength (64, GridUnitType.Absolute) }
},
HorizontalOptions = LayoutOptions.Fill,
ColumnSpacing = 10,
VerticalOptions = LayoutOptions.Center,
};

        grid.Children.Add (UserPicture, 0, 0);
        grid.Children.Add (Message, 1, 0);
        grid.Children.Add (AlbumPreviewPicture, 2, 0);

        View = grid;`

I filled a bug here: https://bugzilla.xamarin.com/show_bug.cgi?id=36470


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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