【发布时间】:2017-12-14 23:55:19
【问题描述】:
尝试初始化此内容页面时,我的代码崩溃了。除静态资源外,一切正常,我尝试取消注释其余部分,这只是静态资源的问题。只有注释掉的代码不起作用。
我不使用 OnPlatform 要求
<?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="ASFT.IssueManager.LoginPage" Padding="10">
<ContentPage.Resources>
<ResourceDictionary>
<x:String x:Key="Labelfont">Medium</x:String>
<x:String x:Key="Titlefont">Large</x:String>
</ResourceDictionary>
</ContentPage.Resources>
<StackLayout Orientation="Vertical" VerticalOptions="Center" HorizontalOptions="FillAndExpand" Spacing="10" >
<StackLayout Orientation="Vertical" VerticalOptions="Start" HorizontalOptions="Center" Spacing="10" WidthRequest="350">
<Label Text="Login" VerticalOptions="Center" HorizontalOptions="Start" FontSize="{StaticResource Titlefont}"/>
<BoxView HeightRequest="5" Color="Gray"/>
<!--<Label Text="Host" VerticalOptions="Center" HorizontalOptions="Start" FontSize="{StaticResource Labelfont}"/>
<Entry Placeholder="Host/URL" Text="{Binding Host}" />
<Label Text="UserName" VerticalOptions="Center" HorizontalOptions="Start" FontSize="{StaticResource Labelfont}"/>
<Entry Placeholder="User name / Account" Text="{Binding Username}" />
<Label Text="Password" VerticalOptions="Center" HorizontalOptions="Start" FontSize="{StaticResource Labelfont}"/>
<Entry Placeholder="Password" IsPassword="true" Text="{Binding Password}" />
<BoxView HeightRequest="5" Color="Gray"/>-->
<Button x:Name="btnLogin" Text="Login" HorizontalOptions="FillAndExpand" Clicked="OnButtonLogin" WidthRequest="100"/>
</StackLayout>
</StackLayout>
</ContentPage>
【问题讨论】:
-
虽然我没有使用 onPlatform
标签: c# xaml xamarin xamarin.forms