c# - 在 Xamarin 的 xmlns 中找不到类型 Ellipse
问题描述
在我的 Xamarin 应用程序中,我试图Ellipse
在 xml 中使用,但它返回了错误:
在 xmlns 中找不到类型 Ellipse
http://xamarin.com/schemas/2014/forms
文档:https ://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/shapes/ellipse
页面.xml
<?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="Osma.Mobile.App.Views.Start" >
<ContentPage.Content>
<StackLayout>
<Ellipse Fill="Red"
WidthRequest="150"
HeightRequest="50"
HorizontalOptions="Start" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
解决方案
您必须在 App.cs 文件中设置标志
public App()
{
Device.SetFlags(new[] {"Shapes_Experimental", "Brush_Experimental"});
InitializeComponent()
}
推荐阅读
- spring-boot - Hi i am trying to learn Apache camel framework. I dont know what i am doing wrong here
- drools - 适用于 JBoss EAP7 的 Drools Business Central Workbench WAR
- c# - 我可以使用 c# 在 Visual Studio 中的同一解决方案中使用两个项目吗
- javascript - 如何从 document.referrer 中获取准确的 url?
- javascript - 如何让 typescript 类型系统知道返回值的类型?
- php - 如何使用 PHP 防止 MySQL 中的重复行?
- javascript - 在弹出窗口中显示多个已选择角度的图像
- c++ - c ++中的非虚拟析构函数具有覆盖
- c# - 属性使用 if - else on set?或上得到?
- c# - 在 ASP.NET Core MVC AddControllers 配置期间注册服务