【发布时间】:2018-01-09 20:43:23
【问题描述】:
我在 Visual Studio 2017 中创建了简单的 xamarin 表单应用程序。当我使用 xaml 预览器打开 xaml 文件时,xaml 预览器仅显示带有文本“XFPagerendererview”作为附加屏幕截图的空白页面。请帮助
Xaml 文件
<?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:local="clr-namespace:App1"
x:Class="App1.MainPage">
<Label Text="Welcome to Xamarin Forms!"
VerticalOptions="Center"
HorizontalOptions="Center" />
<StackLayout Spacing="20" Padding="50" VerticalOptions="Center">
<Entry x:Name="user_id" Placeholder="Mail id"></Entry>
<Entry x:Name="password" Placeholder="Password" IsPassword="True"></Entry>
<Button Text="Log In" TextColor="White" BackgroundColor="##ff77D065" Clicked="NavigateButton_OnClicked"></Button>
</StackLayout>
</ContentPage>
【问题讨论】:
-
可能有不同的原因,因为您没有共享您的 XAML,我会尝试猜测。你有这个特定页面的无参数构造函数吗?
-
@EvZ iam 能够在我的手机和模拟器中运行,但在 xaml 预览器中显示如下。所以 xaml 代码没有问题,似乎配置有问题
-
你没有回答我的第一个问题,请分享 XAML 和背后的代码。
-
@EvZ 添加了 xaml 代码
标签: visual-studio xamarin.forms