Box View in Xamarin Forms
Introduction:
In this
article we are going to learn about box view in xamarin forms. Box view is a
simple box with solid colors. We can change box size, color and other
properties to make it more attractive.
Targeted Audience:
People with
basic knowledge of XAML are the targeted audiences.
Box View:
Let’s start
by making and seeing a simple box view in xamarin forms application.
This figure
shows that how box view will appear on different mobile operating systems.
Implementation:
·
Box View Tag
- <BoxView />
We can use
this tag to make a simple box view in our application we can set different
properties of box view to make it more attractive.
·
Box View Properties
Now set the
width, height and color of box view and see how they will work.
Code:
<BoxView
HeightRequest="150"
WidthRequest="150"
HorizontalOptions="Center"
VerticalOptions="Center"
Color="Gray"/>
Properties:
Here we set
following properties to box view.
- 1- Height Request
- 2- Width Request
- 3- Horizontal Options
- 4- Vertical Options
- 5- Color
Output:
So, the
output will display a Gary Box with 150 height and width and is placed in the
center of page.
So, this is
our simple box view.
Comments
Post a Comment