XAML 如何修复Xamarin错误

zc0qhyus  于 2022-12-07  发布在  其他
关注(0)|答案(1)|浏览(108)
<?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:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:viewcontents="clr-namespace:ProjectFrameworkMob.ViewContents"
             mc:Ignorable="d"
             x:Class="ProjectFrameworkMob.Views.Contact"> NavigationPage.HasNavigationBar="False">

    <ContentPage.Content>
 
            <StackLayout>
                <viewcontents:MainHeaderControl x:Name="HeaderControl" IsVisible="true"></viewcontents:MainHeaderControl>
                <Frame  CornerRadius="10" HasShadow="True"  VerticalOptions="Start" >

                    <StackLayout>

                        <Label Text="Contact Page"  FontSize="30"   VerticalOptions="Fill" HorizontalOptions="Start" FontAttributes="Bold" FontFamily="Roboto" x:Name="lblHeading" ></Label>

                        <Frame Padding="10,5" HasShadow="True"   CornerRadius="5"  BorderColor="DeepSkyBlue" Margin="0,10,0,0">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="40">

                                    </RowDefinition>

                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="30">

                                    </ColumnDefinition>
                                    <ColumnDefinition Width="*"></ColumnDefinition>
                                    <ColumnDefinition Width="40">

                                    </ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <Image Source="Person.png" Scale="0.6" ></Image>
                                <Entry Grid.Column="1" x:Name="lblAppName"
                                 HorizontalOptions="FillAndExpand"
                                    VerticalOptions="Center"
                            Placeholder="Enter Address"
                                  FontSize="Small"
                               TextColor="Black">

                                </Entry>

                            </Grid>
                        </Frame>
                        <Frame Padding="10,5" HasShadow="True"   CornerRadius="5"  BorderColor="DeepSkyBlue"  Margin="0,10,0,0">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="40">

                                    </RowDefinition>

                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="30">

                                    </ColumnDefinition>
                                    <ColumnDefinition Width="*"></ColumnDefinition>
                                    <ColumnDefinition Width="40">

                                    </ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <Entry Grid.Column="1"  x:Name="lblMainTitle"
                                 HorizontalOptions="FillAndExpand"
                                    VerticalOptions="Center"
                            Placeholder="Enter Website URL"
                                  FontSize="Small"
                               TextColor="Black">

                                </Entry>

                            </Grid>

                        </Frame>
                        <Frame Padding="10,5" HasShadow="True"   CornerRadius="5"  BorderColor="DeepSkyBlue"  Margin="0,10,0,0">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="60">

                                    </RowDefinition>

                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="30">

                                    </ColumnDefinition>
                                    <ColumnDefinition Width="*"></ColumnDefinition>
                                    <ColumnDefinition Width="40">

                                    </ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <Editor  Grid.Column="1"  x:Name="lblMainDesc"
                                 
                            Placeholder="Enter Phone Number"
                                  FontSize="Small"
                               TextColor="Black">
                                </Editor>
                            </Grid>
                        </Frame>
                        <Button BackgroundColor="Green" Text="Get Contact Details" VerticalOptions="EndAndExpand" CornerRadius="5" Margin="0,15,0,0" Clicked="GetSettings_Clicked"></Button>
                        <Button BackgroundColor="CornflowerBlue" Text="Update Contact Details" VerticalOptions="EndAndExpand" CornerRadius="5" Margin="0,15,0,0" Clicked="UpdateSettings_Clicked"></Button>
                        <Label Text="Status" TextColor="Brown" FontSize="Medium" x:Name="lblStatus" HorizontalOptions="Center"></Label>
                    </StackLayout>
                </Frame >
                <Frame  CornerRadius="5"  Margin="0,0,0,10">
                <StackLayout>
                    <Button BackgroundColor="Red" Text="Logout" CornerRadius="5" Clicked="Logout_Clicked" ></Button>
                    </StackLayout>
                </Frame>
            </StackLayout>
        </ContentPage.Content>
</ContentPage>

严重性代码描述项目文件行禁止显示状态错误找不到“Content”的属性、可绑定的属性或事件,或者值与属性之间的类型不匹配。ProjectFrameworkMob D:\Kts\project framework new\ProjectFramework\ProjectFramework\ProjectFrameworkMob\ProjectFrameworkMob\Views\Contact.xaml 1

rdlzhqv9

rdlzhqv91#

此行将破坏XAML结构

x:Class="ProjectFrameworkMob.Views.Contact"> NavigationPage.HasNavigationBar="False">

它应该

x:Class="ProjectFrameworkMob.Views.Contact" NavigationPage.HasNavigationBar="False">

相关问题