Xamarin.Forms是一款Microsoft产品,允许从单个共享C#代码库为Android,iOS,Windows和其他应用程序构建本机,跨平台应用程序。
Nuget 更新后 VS Xamarin 应用程序中找不到资源错误
我编写了一个已经运行了好几年的应用程序。今天,遗憾的是,我更新了 Nuget 软件包,现在出现了如下错误。 我安装了最新的 Android SDK(Android API 32,
如何从 Android Activity 启动 Xamarin 表单
问题是如何从 Android 中的活动导航到 xamarin 表单 我的整个项目都在 Xamarin Android 中,但我必须调用同一项目中的 XAML(xamarin 表单) 我尝试...
如何动态更改 .net maui 应用程序中的 firebase 配置?
我正在构建一个.Net MAUI 应用程序。在 MAUIProgram.cs 中的应用程序初始化期间,我正在注册 firebase 服务。然而启动后,当登录屏幕出现时...
如何使用 Xamarin Forms 中的转换器将布尔值转换为文本和颜色
我想使用布尔值绑定 FontAwesome/MaterialFont 图标和颜色。我已成功绑定字体图标,但无法绑定颜色。 isSQL 是布尔值 代码... ...
我想创建一个资金管理应用程序,我使用选项卡栏进行导航(只需编辑选项卡式应用程序模板) 应用程序有 4 个选项卡:支出、收入、统计和历史。 支出和收入相同
我有这个命名空间: 使用安卓系统; 使用Android.App; 使用 Android.Content.PM; 使用Android操作系统; 我想把 Xamarin.FormsMaps.Init(this, savingInstanceState);在受保护的覆盖无效中
我目前正在尝试了解如何使用我的 Xamarin Form 应用程序获取我当前进入的 (xaml) 页面的名称。 我该怎么做呢?我尝试了各种情况,甚至环顾四周......
StaticResource 不适用于 Xamarin 表单
我是 Xamarin 新手 我有这段代码,Style="{StaticResource MyStyleButton}" 在其他页面中不起作用。 组件页面.xaml 我是 Xamarin 新手 我有此代码,但 Style="{StaticResource MyStyleButton}" 在其他页面中不起作用。 componentPage.xaml <ContentPage.Resources> <ResourceDictionary> <Style x:Key="MyStyleButton" TargetType="Button"> <Setter Property="BackgroundColor" Value="#2196f3" /> <Setter Property="WidthRequest" Value="300" /> <Setter Property="CornerRadius" Value="20" /> <Setter Property="FontSize" Value="Medium" /> <Setter Property="TextColor" Value="White" /> </Style> </ResourceDictionary> </ContentPage.Resources> 另一个 xaml 文件 登录页面.xaml <ContentPage.Content> <StackLayout> <Button Command="{Binding Command1}" Style="{StaticResource MyStyleButton}" Text="Button1" /> </StackLayout> </ContentPage.Content> 如果我将它们放在同一个文件中,代码就可以工作, 我应该改变什么 第 1 步:创建新的 ContentPage 示例名称 ButtonStyles.xaml 第 2 步:编辑 <?xml version="1.0" encoding="utf-8" ?> <ContentPage x:Class="YourAppName.ButtonStyles" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"> ... </ContentPage> 至 <?xml version="1.0" encoding="utf-8" ?> <ResourceDictionary x:Class="YourAppName.ButtonStyles" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"> .... </ResourceDictionary> 在代码隐藏中 using Xamarin.Forms.Internals; [Preserve(AllMembers = true)] [XamlCompilation(XamlCompilationOptions.Compile)] public partial class ButtonStyles { public ButtonStyles() { InitializeComponent(); } } 第 3 步:将您的样式放入 ButtonStyles.xaml <?xml version="1.0" encoding="utf-8" ?> <ResourceDictionary x:Class="YourAppName.ButtonStyles" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"> <Style x:Key="MyStyleButton" TargetType="Button"> <Setter Property="BackgroundColor" Value="#2196f3" /> <Setter Property="WidthRequest" Value="300" /> <Setter Property="CornerRadius" Value="20" /> <Setter Property="FontSize" Value="Medium" /> <Setter Property="TextColor" Value="White" /> </Style> <Style x:Key="MyStyleButton2" TargetType="Button"> ..... </Style> </ResourceDictionary> 第 4 步:在您的 App.xaml <?xml version="1.0" encoding="utf-8" ?> <Application x:Class="YourAppName.App" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:YourAppName;assembly=YourAppName"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <local:ButtonStyles /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application> 第 5 步:在您的任何内容页面中 <?xml version="1.0" encoding="utf-8" ?> <ContentPage x:Class="YourAppName.MainPage" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"> <StackLayout> <Button Command="{Binding Command1}" Style="{StaticResource MyStyleButton}" Text="Button1" /> <Button Command="{Binding Command2}" Style="{StaticResource MyStyleButton}" Text="Button2" /> <Button Command="{Binding Command3}" Style="{StaticResource MyStyleButton}" Text="Button3" /> </StackLayout> </ContentPage> 你身边也有这种方式,你也可以把它放在Application.Resources中并在每个页面中使用它。 https://learn.microsoft.com/en-us/xamarin/xamarin-forms/xaml/resource-dictionaries 在 App.xaml 中 <Application.Resources> <Style x:Key="MyStyleButton" TargetType="Button"> <Setter Property="BackgroundColor" Value="#2196f3" /> <Setter Property="WidthRequest" Value="300" /> <Setter Property="CornerRadius" Value="20" /> <Setter Property="FontSize" Value="Medium" /> <Setter Property="TextColor" Value="White" /> </Style> </Application.Resources> 在您喜欢的任何页面中使用 <ContentPage.Content> <StackLayout> <Button Command="{Binding Command1}" Style="{StaticResource MyStyleButton}" Text="Button1" /> </StackLayout> </ContentPage.Content>
我正在尝试开发一个自定义控件,以便在 MAUI 中滑动接受。有人可以帮我提供任何可能有助于开发此功能的文档或相关控件吗? 我尝试使用滑动
我创建了一个具有步骤属性的自定义视图(NavProgressbar)。 私有静态只读 BindableProperty ProgressStepProperty = BindableProperty.Create( 名称(进度步骤),类型...
如何修复错误类型“object”不能用作泛型类型或方法中的类型参数“TToken”?
我正在从 Xamarin Forms 迁移到 .NET MAUI。这里我将Xamarin Forms的MessagingCenter转换为.NET MAUI的WeakReferenceManager。这是我的 Xamarin Forms 代码:
如果我在我的应用程序中管理会话(任何会话概念都适用),并且我认为会话已过期,无论出于何种原因,我如何以编程方式重新启动应用程序,普遍...
在网格布局中,当键盘在xamarin.forms中打开时如何滚动页面?
我在 xamarin.forms 中遇到一个问题。我正在使用 GridView 进行登录页面设计,因此可以相应地更改设备高度和宽度。我不想滚动该页面所以我没有放置任何 Scro...
Xamarin Forms / Maui 从 Android 连接和断开到 IoT 设备 WiFi 接入点
我正在维护一个用Xamarin表单(Android)编写的应用程序来控制物联网设备。 我面临的问题与用户连接到 IoT 设备以为其提供 WiFi 连接有关
即使添加了 android:exported 值之后,也需要为元素显式指定获取 android:exported
将目标版本更新到 33 时,我的 Xamarin Forms android 项目出现以下错误。 严重性代码 说明 项目文件行抑制状态 错误 android:ex...
Xamarin 表单 Imagesource 无法在 Android 上运行
所以我正在开发一个项目,想要从我的服务器获取图像到应用程序。 我使用图像源来获取我需要的图像,它在 UWP 上运行良好,但当我在 Android 上测试它时,它却......
我想在我的应用程序打开时禁用自动锁定。我怎样才能做到这一点?
在 Xamarin Android 中读取 QR 码或条形码
请问,有人知道如何在 Xamarin Android 中读取二维码或条形码吗?我只在 Xamarin Forms 中找到了带有 zxing 库的示例,但我只需要使用 Xamarin Android 来完成此操作。 我尝试过...
Xamarin Android Java 绑定库.aar CS0102 类型“EventEventArgs”已包含“p0”的定义
// com.elotouch.library.EloPeripheralEventListener.onEvent 的事件参数 公共部分类 EventEventArgs : global::System.EventArgs { 公共事件事件参数(int p0) { 这个.p0 ...
“链接全部”时 Xamarin Forms iOS NoConstructorFoundException 与 AutoFac,以及“不链接”时的无限构建
在物理 iPhone 上构建和部署适用于 iOS 的 Xamarin Forms 应用程序时,我遇到了一个令人困惑的问题。该应用程序在 Android 上成功构建和部署,它也适用于 iOS 模拟器...