【问题标题】:Why dont't I get the intellisense suggestions for the pages in my project after setting up the local XML namespace为什么设置本地 XML 命名空间后,我的项目中的页面没有得到智能感知建议
【发布时间】:2019-01-28 04:40:48
【问题描述】:

我尝试创建一个类似于 Instagram 的应用程序,为此我需要使用选项卡式页面。问题是当我想使用本地 XML 命名空间将不同的页面添加到我的选项卡式页面时,我收到此错误“找不到类型“本地”。您是否缺少程序集引用并且所有程序集都已构建?“。

我已经将本地 xml 命名空间添加到我的标签页的 xaml 代码中,例如 "xmlns:local="cls-namespace:InstagramApp">"

我搜索了谷歌,发现这个话题有点相关https://forums.xamarin.com/discussion/22762/local-xaml-namespace-in-shared-project,但这并没有解决我的问题。

我还搜索了stackoverflow,但找不到任何相关主题。

这是我正在使用的标签页的 xmal:

<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="InstagramApp.TabbedPage1"
            xmlns:local="cls-namespace:InstagramApp">

    <local: Profile />
</TabbedPage>

我想要的是在我输入 &lt;local: Profile&gt; 时获得智能感知建议,个人资料是我想要添加到我的标签页的页面。 抱歉,如果我的术语不正确。我是编程新手。

提前致谢。

【问题讨论】:

    标签: c# xaml xamarin.forms xml-namespaces tabbedpage


    【解决方案1】:

    我发现问题出在 xaml 命名空间声明中。我使用了xmlns:local="cls-namespace:InstagramApp"&gt; 而不是xmlns:local="clr-namespace:InstagramApp"&gt;

    我在 clr 中使用了 s 而不是 r。

    【讨论】:

      猜你喜欢
      • 2013-04-11
      • 1970-01-01
      • 1970-01-01
      • 2013-01-06
      • 2014-01-08
      • 1970-01-01
      • 1970-01-01
      • 2017-03-16
      • 1970-01-01
      相关资源
      最近更新 更多