【发布时间】:2017-07-11 01:17:02
【问题描述】:
<?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="XamlTest.HelloXamlPage">
<Label Text="Hello, XAML!"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Rotation="-15"
IsVisable="true"
FontSize="Large"
FontAttributes="Bold"
TextColor="Black"
/>
</ContentPage>
这是一个基本示例,但问题是这段代码写在另一个 Forms XAML 页面上,而不是默认的主 XAML 页面 (MainPage.xaml),默认的运行良好,没有问题,但另一个 XAML 页面不工作,给我这个例外:
Xamarin.Forms.Xaml.XamlParseException:位置 9:10。无法分配 属性“IsVisable”:属性不存在,或不可分配, 或者值和属性的类型不匹配
我已经更改了公共应用程序中的代码
public partial class App : Application
{
public App()
{
InitializeComponent();
MainPage = new XamlTest.HelloXamlPage(); // called HelloXamlPage instead of MainPage();
}
调用 HelloXamlPage 而不是 MainPage(); 所以任何人都可以帮助我吗?
【问题讨论】:
-
你打错字了——
IsVisible。
标签: c# xaml xamarin xamarin.forms cross-platform