Forum Xamarin.Forms

Specifying ContentPage BackgroundImage with a Style and using xcassets

JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭
edited May 2016 in Xamarin.Forms

I'm using images.xcassets for my iOS application, for my AppIcon and LaunchImage.

I now need to specify a background image for all my ContentPages, and want to do so using a Style. To this end I've got a style:

<Style
    TargetType="ContentPage">
    <Setter
        Property="BackgroundImage"
        Value   ="BackgroundImage" />
</Style>

defined in my App.xaml.

I've created a new Image Set called BackgroundImage in my Images.xcassets, and have used the Asset Catalog Creator to create BackgroundImage.png, [email protected] and [email protected] and have added these to the BackgroundImage Image Set.

However, I'm not seeing the background image when I run the app.

Any suggestions/hints please?

Best Answer

Answers

Sign In or Register to comment.