The last thing we will do to this view, for the moment, is add a background image. The image we will be using in this example is a result of a Google search for images that are free to use. Let's set this up:
- In the Weather project, open the MainView.xaml file.
- Set the Background property of ScrollView to Transparent.
- Add an Image element in Grid with UriImageSource as the value of the Source property.
- Set the CachingEnabled property to true and CacheValidity to 5. This means that the image will be cached in 5 days.
- The XAML should now look as follows:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:Weather.Controls"
x:Class="Weather.Views.MainView" Title="{Binding
City}">
<ContentPage...