Laying out the contents
This last section is about making the app look a bit nicer. We will just scratch the surface of the possibilities here, but this should give you some ideas about how styling works.
Setting an application-wide background color
Styles are a great way of applying styling to elements. They can be applied either to all elements of a type or the elements referenced by a key if you add an x:Key
attribute:
- Open
App.xaml
. - Add the following XAML, which is in bold, to the file:
<ResourceDictionary> <Style TargetType="NavigationPage"> <Setter Property="BarBackgroundColor" Value="#A25EBB" /> <Setter Property="BarTextColor" Value="#FFFFFF" /> </Style> <Style x:Key="FilterButton" TargetType="Button"> <Setter Property="Margin" Value=...