xamarin - 为什么 xaml 选项卡式页面属性 local 在这种情况下不起作用?
问题描述
我有一个非常简单的 xaml 代码,但属性 local:Page 根本不起作用,当我键入“local”时,它会加下划线,就好像有错误一样。
MainPage.xaml:
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Solution;assembly=Solution"
x:Class="Solution.MainPage">
<local:Listar Title="XXXX" />
</TabbedPage>
Listar.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:Solution;assembly=Solution"
x:Class="Solution.Listar">
<ContentPage.Content>
<StackLayout>
<Label Text="Welcome to Xamarin.Forms!"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
解决方案
TabbedPage 必须包含子页面。
<TabbedPage.Children>
<local:Listar Title="XXX"/>
</TabbedPage.Children>
推荐阅读
- tensorflow - tensorflow的会话运行接口是可重入的吗?
- c# - 如何使 WT41N0 扫描仪不扫描条形码或将回车符传递给 C# 中的 messageBox
- json - ReactJS - 为什么删除数组重复项的功能会导致下拉列表出现故障
- libgdx - Libgdx 处理 Sprite 批处理错误
- javascript - 仅在桌面版本上使 js 代码异步
- angular - 在字符串Angular中使用for循环索引
- c++ - 未编译所有数据
- wordpress - 页面未在 Chrome 中请求视频
- tensorflow - 填充=相同时的Keras Conv2D尺寸计算
- android - 关于Android理解VpnService代码的问题