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

ContentPage backgroundcolor style in App.xaml does not work

$
0
0

I'm trying to style each ContentPage instance so that the background color is set to a particular color.

  <Application.Resources>
    <ResourceDictionary>
      <Style TargetType="ContentPage">
        <Setter Property="BackgroundColor" Value="Lime" />
      </Style>
    </ResourceDictionary>
  </Application.Resources>

However, my content pages do not have the above background color. For example, this is the stock MainPage.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:App2"
             x:Class="App2.MainPage">

  <Label Text="Welcome to Xamarin Forms!"
           VerticalOptions="Center"
           HorizontalOptions="Center" />

</ContentPage>

Is this a bug or can we not style pages application-wide?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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