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

Images from ViewCell is missing when run on Device

$
0
0

Sometimes I use iOS simulator to test and I'm doing ViewCells to my tables with back ground images.

Check the code:

var absoluteLayout = new AbsoluteLayout();
var background = new Image
{
    Style = Styles.CellBackground
};
absoluteLayout.Children.Add(background, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);
absoluteLayout.Children.Add(stackLayout, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);

Obviously the absolute layout is to put the items on stack over the image.

So I noticed when it's running on simulator the the images is there, but on the iOS device is missing.
I use an icon too, but it isn't on the absolute. It's on the stack and I can see it.

The style above is the follow:

public static Style CellBackground = new Style(typeof(Label))
        {
            Setters = {
                new Setter { Property = Image.SourceProperty, Value = Images.cellBackground },
                new Setter { Property = Image.AspectProperty, Value = Aspect.Fill },
                new Setter { Property = View.HorizontalOptionsProperty, Value = LayoutOptions.Start },
                new Setter { Property = View.VerticalOptionsProperty, Value = LayoutOptions.Center },
            }
        };

Viewing all articles
Browse latest Browse all 91519

Trending Articles



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