Forum Xamarin.Forms

Show Border in Grid (Xaml)

BuiManhBuiManh USMember ✭✭

I have problem with showing Border of grid in xaml.
I have Xaml page like this:

                                <?xml version="1.0" encoding="utf-8" ?>
                                <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                                             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                                             x:Class="DAC_Check.Views.HistoryPage" BackgroundColor="White">

                                  <ContentPage.Content >
                                    <ListView    CachingStrategy="RecycleElement"
                                           SeparatorColor="Transparent"
                                           HasUnevenRows="True"
                                           x:Name="ListViewNews">
                                      <ListView.ItemTemplate>
                                        <DataTemplate>
                                          <ViewCell>
                                            **<Border BorderBrush="Black" BorderThickness="2">**
                                              <Grid ShowGridLines="True" Padding="3">
                                                <Grid.ColumnDefinitions>
                                                  <ColumnDefinition Width="55"/>
                                                  <ColumnDefinition Width="*"/>
                                                </Grid.ColumnDefinitions>

                                                <Image Source="{Binding IMG}" VerticalOptions="Center">
                                                  <Image.WidthRequest>
                                                    <OnPlatform x:TypeArguments="x:Double">
                                                      <OnPlatform.iOS>55</OnPlatform.iOS>
                                                      <OnPlatform.Android>55 </OnPlatform.Android>
                                                      <OnPlatform.WinPhone>75</OnPlatform.WinPhone>
                                                    </OnPlatform>
                                                  </Image.WidthRequest>
                                                  <Image.HeightRequest>
                                                    <OnPlatform x:TypeArguments="x:Double">
                                                      <OnPlatform.iOS>50</OnPlatform.iOS>
                                                      <OnPlatform.Android>50</OnPlatform.Android>
                                                      <OnPlatform.WinPhone>65</OnPlatform.WinPhone>
                                                    </OnPlatform>
                                                  </Image.HeightRequest>
                                                </Image>
                                                <StackLayout Grid.Column="1"
                                                             Padding="4"
                                                             Spacing="4"
                                                             VerticalOptions="Center">
                                                  <Label Text="{Binding Title}" Font="Bold,13" TextColor="Black" />
                                                  <Label Text="{Binding PublicDate}" x:Name="lbDate" FontSize="Small" LineBreakMode="WordWrap"/>
                                                  <Label/>
                                                </StackLayout>
                                              </Grid>
                                            </Border>
                                          </ViewCell>
                                        </DataTemplate>
                                      </ListView.ItemTemplate>
                                    </ListView>
                                  </ContentPage.Content>
                                </ContentPage>

When run it, the debug show that:

Xamarin.Forms.Xaml.XamlParseException: Position 14:14. Type Border not found in xmlns http://xamarin.com/schemas/2014/forms

How can i fix that???

Answers

Sign In or Register to comment.