xamarin 相关问题

Xamarin是一个由Xamarin.iOS,Xamarin.Android,Xamarin.Mac和Xamarin Test Cloud组成的平台。它允许您编写适用于iOS,Android和Mac的跨平台本机应用程序,并在整个生命周期内关注您的应用程序。 Xamarin.Forms的引入支持iOS,Android和Windows的Native UI开发

Xamarin:无法将存档上传到 AppStore

Visual Studio 2019(Windows)/ Xamarin 4.7.0.968 我创建了一个 iOS 存档(没有错误),但是当我选择 Distribute / AppStore 并选择我已经在 Visual Stud 中设置的 ID/配置文件时...

回答 7 投票 0

滚动 ListView 时出现错误“无法访问已处置的对象”

我收到错误: '无法访问已处置的对象。对象名称: 'Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer'。'。 当我向 ListView 添加更多项目并尝试滚动时会发生这种情况...

回答 2 投票 0

Java HotSpot(TM) 64 位服务器 VM 警告:选项 UseConcMarkSweepGC 已在版本 9.0 中弃用,并且可能会在未来版本中删除

我在安装 JAVA 11 (LTS) 和 Visual studio 2022 Community Edition 后遇到此问题。和Andriod Studio。在我的全新 AMD PC 中(具有开发的全部能力)。但安装完之后...

回答 1 投票 0

Xamarin - 将 ListView 子项绑定到自定义列表属性

我在绑定到列表视图时遇到问题。 视图模型: 公共类 MainPageViewModel :INotifyPropertyChanged { 公共 MainPageViewModel() { } 私有 ObservableCollection<...

回答 1 投票 0

在 C# 中将 DataUrl 转换为图像并使用字节写入文件

你好,我的签名是这样的: 它被编码为一个数据 URL,特别是这个字符串: 数据:图像/ png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAADICAYAAADGFbfiAAAYlElEQVR4Xu2dC8w1R1nHQSCIgIKVGLmoiLc...

回答 2 投票 0

启动画面活动背景颜色

我的 Android 启动画面有问题。 在长时间的应用程序启动过程中向用户显示启动屏幕,但活动背景始终为黑色。我的意思是背景位图(飞溅我...

回答 4 投票 0

Xamarin.Forms 中的EventToCommandBehaviorrelativeSource

为什么不起作用? 为什么不起作用? <Editor Text="{Binding OptionText}"> <Editor.Behaviors> <xct:EventToCommandBehavior EventName="Focused" Command="{Binding CheckEditorViewCommand,Source={RelativeSource AncestorType={x:Type view:SurveyViewModel}}}" /> </Editor.Behaviors> </Editor> 当我尝试使用此 xaml 代码打开页面时,应用程序崩溃。 01-14 07:50:43.611 F/mono-rt (28519): [错误] 致命未处理 异常:System.InvalidOperationException:操作无效 由于对象的当前状态。 01-14 07:50:43.611 F/单声道 (28519):在 Xamarin.Forms.Binding.ApplyRelativeSourceBinding (Xamarin.Forms.BindableObject 目标对象, Xamarin.Forms.BindableProperty targetProperty) [0x00041] 在 D: \s\Xamarin.Forms.Core\Binding.cs:158 01-14 07:50:43.611 F/mono-rt (28519):位于 System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object 状态) [0x00000] 中 /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021 01-14 07:50:43.611 F/mono-rt (28519): 在 Android.App.SyncContext+<>c__DisplayClass2_0.b__0 () [0x00000] 在 /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:36 01-14 07:50:43.611 F/mono-rt (28519): 在 Java.Lang.Thread+RunnableImplementor.Run()[0x00008]中 /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:36 01-14 07:50:43.611 F/mono-rt (28519): 在 Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] 中 /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-33/mcw/Java.Lang.IRunnable.cs:84 01-14 07:50:43.611 F/mono-rt (28519): 在 Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V (_JniMarshal_PP_V 回调、System.IntPtr jnienv、System.IntPtr klazz) [0x00005] 在 /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:22 01-14 07:50:43.611 F/mono-rt (28519): at (包装器本机到托管) Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V(intptr,intptr) 当我放下这是鳕鱼时,页面就会工作。 我已经以绑定方式理解了这个问题,但我不明白如何正确执行。 我用这种绑定方法解决了我的问题: <Editor Text="{Binding OptionText}"> <Editor.Behaviors> <xct:EventToCommandBehavior EventName="TextChanged" CommandParameter="{Binding .}" Command="{Binding Source={x:Reference Name=SurveyPageCustomName}, Path=BindingContext.CheckEditorViewCommand}" /> </Editor.Behaviors> </Editor> 我不知道为什么,但这Command="{Binding CheckEditorViewCommand,Source={RelativeSource AncestorType={x:Type view:SurveyViewModel}}}"不适用于行为,但适用于TapGestureRecognizer。这让我很困惑。

回答 1 投票 0

如何在xamarin表单中显示进度条通知

我正在使用 xamarin 表单,我遇到了这个插件 https://github.com/thudugala/Plugin.LocalNotification 以便向用户显示通知。但是如何才能在通知上显示进度条...

回答 2 投票 0

didFailProvisionalLoadForFrame 对于某些 URL 但在 Safari 中工作正常

我遇到了一个奇怪的问题,即某个域无法在 WKWebView 中加载。它给出了一个错误: WebPageProxy::didFailProvisionalLoadForFrame:frameID=3,域=NSURLErrorDomain,代码=-1200 我是...

回答 2 投票 0

在属性面板中找不到构建操作 - Xamarin Forms

正在使用 Visual Studio 2022 的 Xamarin 表单构建应用程序,我想嵌入位于可绘制文件夹中的汽车图像资源,但当我选择...时,构建操作不会出现在其属性中

回答 1 投票 0

.NET MAUI 循环后台作业每天运行几次

我希望有一个后台作业每天运行2-3次,但更少也没关系。这只是对我的服务器的快速 api 调用,不需要更新 UI,事实上我更喜欢它运行时...

回答 2 投票 0

.NET MAUI 中的 Shell 背景渐变

知道如何为 Shell 提供渐变背景吗? 我尝试在 Shell 背景上定义 LinearGradientBrush 但这不起作用。 知道如何为 Shell 提供渐变背景吗? 我尝试在 Shell 背景上定义 LinearGradientBrush,但这不起作用。 <?xml version="1.0" encoding="UTF-8" ?> <Shell xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"> <Shell.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> <GradientStop Color="Yellow" Offset="0.0" /> <GradientStop Color="Red" Offset="0.25" /> <GradientStop Color="Blue" Offset="0.75" /> <GradientStop Color="LimeGreen" Offset="1.0" /> </LinearGradientBrush> </Shell.Background> <FlyoutItem FlyoutDisplayOptions="AsMultipleItems"> <!-- FlyoutItem contents here --> </FlyoutItem> </Shell> 我已经确认这是为 Shell.Background 设置渐变时的已知问题,请参阅 Shell.Background - Gradient does not work #10445,您可以按照该线程进行操作。 幸运的是,您可以单独设置渐变背景。如果您有“外壳”弹出窗口,则可以为“外壳”弹出项目设置渐变背景: <Shell.FlyoutBackground> <LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> <GradientStop Color="Yellow" Offset="0.0" /> <GradientStop Color="Red" Offset="0.25" /> <GradientStop Color="Blue" Offset="0.75" /> <GradientStop Color="LimeGreen" Offset="1.0" /> </LinearGradientBrush> </Shell.FlyoutBackground> 另外,如果要将 ShellContent 背景设置为渐变背景,可以将渐变背景添加到 ContentPage 的背景属性中。 <ContentPage.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> <GradientStop Color="Yellow" Offset="0.0" /> <GradientStop Color="Red" Offset="0.25" /> <GradientStop Color="Blue" Offset="0.75" /> <GradientStop Color="LimeGreen" Offset="1.0" /> </LinearGradientBrush> </ContentPage.Background> 希望这有帮助!

回答 1 投票 0

如何限制用户在xamarin中选择相机应用程序

我正在 Xamarin 上编写一个项目,我的任务是限制用户从除默认 Android 相机之外的任何应用程序获取照片。我曾尝试使用 ActionImageCapture 打开相机,但有一些

回答 1 投票 0

Visual Studio 2022 管理 nuget 包灰显

我不明白为什么我突然无法管理我的nuget包?有人遇到过这样的问题吗

回答 4 投票 0

Microsoft MAUI:如何在 MAUI 中创建在新窗口中打开的报告?

如何在 MAUI 中创建在新窗口中打开的动态报告?

回答 2 投票 0

使用 MKCreateClusterAnnotation Xamarin Forms 显示集群视图

如何使用 ios 地图渲染对 pin 结果进行分组或聚类? 我尝试了以下逻辑,但我在实现中感到困惑。 https://github.com/xamarin/ios-samples/blob/main/ios11/MapKitS...

回答 1 投票 0

Xamarin.Android 应用程序关闭时调用函数

我想从 Xamarin.Android 项目中的 MainActivity.cs 调用函数。 我需要在我的应用程序关闭后调用我的函数,而不是在应用程序窗口隐藏时调用我的函数。当我尝试使用 OnSt 时...

回答 1 投票 0

xamarin.android 应用程序关闭时调用 void

我想从 xamarin.android 项目中的 mainactivity.cs 调用函数。 我需要在我的应用程序关闭后调用我的函数,而不是在应用程序窗口隐藏时调用我的函数。当我尝试使用 OnSt 时...

回答 1 投票 0

将 Xamarin 应用程序移植到毛伊岛。很少发生启动崩溃。 (不超过五分之一)

似乎在GC线程上。 (单原) mono sgen 正在调用 CryptoNative_HmacUpdate,然后运行一些 java,然后在 libcrypto.so 中调用 HMAC_Update(这是一个本机 android lib,例如...

回答 1 投票 0

如何将 XAML(或另一个 ContentView)作为子项传递给 ContentView

我正在尝试创建一个 ContentView,并在其中将子项作为 XAML 或(另一个内容视图)传递。我怎样才能做到这一点? 例如。: 我有一种观点说 Header.xaml 我正在尝试创建一个 ContentView,并在其中将子项作为 XAML 或(另一个内容视图)传递。我怎样才能做到这一点? 例如: 我有一种观点是 Header.xaml <?xml version="1.0" encoding="utf-8" ?> <ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:strings="clr-namespace:Eurynote.Localization.Resources.en;assembly=Eurynote.Localization" x:Class="Eurynote.Core.Views.Common.EurynoteHeader"> <HorizontalStackLayout Spacing="10" VerticalOptions="Center"> <Image Source="brand_icon" WidthRequest="32" HeightRequest="30" /> <Label Text="Header" Margin="0,-3,0,0" /> </HorizontalStackLayout> </ContentView> 现在,在我的 MainPage.xaml 文件中,我可以将此视图称为 <common:Header /> 并且运行良好。 但是我如何将另一个控件传递到与子项相同的内容视图,例如按钮、标签等...或任何其他 ContentView,如下面两个示例所示。 <common:Header> <Button Text="Button" /> </common:Header> <common:Header> <common:AnotherView /> </common:Header> 我想确保只能传递单个内容,如Frame。 谢谢你!!! 首先,如果使用以下代码,ContentView的内容将被Button覆盖。 <common:Header> <Button Text="Button" /> </common:Header> 因此您无法从 xaml 中为 contentview 添加子项。但你可以在后面的代码中做到这一点。如: 在xaml中: <common:Header x:Name = "header"> 在页面的构造函数中: public partial class MainPage() { InitializeComponent(); var layout = head.Content as HorizontalStackLayout; layout.Children.Add(new Button(){ Text = "new button"}); } 您可以通过这种方式将新项目作为子项添加到内容视图中。

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.