草庐IT

c# - 通过呈现新的 View Controller viewWillDisappear 在我取消订阅事件的地方被触发

在我的主视图Controller上,我有一个显示另一个ViewController的按钮,可以在其中更改一些设置:PresentViewController(newUINavigationController(anotherViewController),true,null);对于anotherViewController的解雇,parent应该负责。我还必须知道是否有什么改变(保存)。因此我使用事件。我在父ViewController的viewWillAppear中附加事件处理程序anotherViewController.DismissMe+=CancelEventHandler;

CodeRunner 2 中的 C# 程序集

我正在使用CodeRunner2(2.0.3)并且我无法在C#中编译代码。我收到警告:/Users/Username/Library/ApplicationSupport/CodeRunner/Languages/C#.crLanguage/Scripts/compile.sh:line25:gmcs:commandnotfoundInordertorunC#code,youneedtohaveMonoinstalled.Youcangetitathttp://mono-project.com我安装了Mono,我安装了XamarinStudio并尝试通过它。一些基本的东西起作用所以我知

ios - 使用 Xamarin 的通用约束

我有以下具有通用类型约束的通用类型。publicclassGenericTypewhereT:IFoo{}然后我尝试从开放泛型类型创建封闭泛型类型。varfooGenericType=typeof(GenericType).MakeGenericType(typeof(IFoo));varintGenericType=typeof(GenericType).MakeGenericType(typeof(int));在模拟器中运行时,它无法尝试使用int作为预期的类型参数来创建封闭的泛型类型。但是,当在实际设备(iPhone)上运行时,它还会使用int创建一个封闭的通用类型。它似乎不遵守

ios - Xamarin Forms : ImageSource. FromUri 不显示

我有一个项目列表,每个项目都有一个图像(从远程服务器下载),如下所示:varimage=newImage{WidthRequest=44,HeightRequest=44,};image.SetBinding(Image.SourceProperty,newBinding("ImageUrl"));几乎所有图像在iPhone5S和6+(模拟器/真实设备)中都能正常显示。但是,有一张图片在iPhone6+(模拟器/读取设备)上不显示。我尝试不设置Width和HeightRequest,但没有解决问题。这是特殊图像的信息:Size:9KB(12KBondisk)Dimension:608x

c# - 从 iOS TabBar 移除着色

我的View底部有一个TabBar,我不想对其进行任何着色。与iOS7一样,iOS会自动将图标染成蓝色,我不希望这种情况发生。我曾尝试编写自定义渲染器,但将色调颜色设置为清除只会删除图标(应该已经看到了)。protectedoverridevoidOnElementChanged(VisualElementChangedEventArgse){base.OnElementChanged(e);TabBar.TintColor=UIKit.UIColor.Clear;}我想要没有任何着色的选项卡项目图像。如何做到这一点? 最佳答案 如

C# AutoResetEvent 不释放

使用Xamarin.Forms(适用于iOS),我尝试实现在继续之前等待用户确认已设置GeoLocation权限的功能。我尝试实现这一点的方法是让线程等待直到使用AutoResetEvent触发事件。.主要问题(我相信)位于以下代码中:manager.AuthorizationChanged+=(objectsender,CLAuthorizationChangedEventArgsargs)=>{Console.WriteLine("Authorizationchangedto:{0}",args.Status);if(UIDevice.CurrentDevice.CheckSyst

ios - Xamarin iOS Designer xib 在文档大纲中缺少 'Files Owner'、 'ViewController' 对象

我是Xamarin初学者,使用MvvmCross从事跨平台移动项目.我刚刚升级到Xcode7和XamarinStudio5.10并尝试在XamariniOSDesigner中使用旧的iOSxib文件而不是Xcode。虽然xib没有ViewController对象,但以前,当xib在Xcode6中打开时,我可以将socket直接连接到Designer中缺少的FilesOwner(请参阅下图)。我有两个问题为什么在MvvmCross中创建的ViewControllerxib不包含ViewController对象如何在XamariniOSDesigner中访问“文件所有者”?

android - 如何使用 Xamarin.Mobile 读取跨平台应用程序的联系人

我正在对构建跨平台应用程序的程序和框架进行一些评估。现在,我只是尝试使用Xamarin.Mobile加载设备的联系人。我找到了这个指南:http://components.xamarin.com/view/xamarin.mobile但是当我输入varbook=newXamarin.Contacts.AddressBook();VisualStudio时显示错误:'Xamarin.Contacts.AddressBook'doesnotcontainaconstructorthattakes0arguments我在Xamarin网站上找到的所有其他方法或指南都是特定于Android或i

c# - 在我自己的 "UITableViewController"中使用默认实现使方法可选

我在Xamarin.iOS中编写了自己的UIViewController实现:publicclassHUDTableViewController:UIViewController,IUITableViewDataSource,IUITableViewDelegate,IDisposable{privateUITableViewtableView;publicUITableViewTableView{get{returnthis.tableView;}set{this.tableView=value;}}publicoverridevoidViewDidLoad(){base.ViewD

c# - Xamarin : iOS won't send punctuation in strings to a web endpoint

非常奇怪的问题,我将ServiceStack用作WebAPI,并且我设置了一个标准端点,我应该能够将字符串发布到该端点。但是,在我的iOS设备上,我无法发送带有任何标点符号的字符串。有些只会让应用程序完全崩溃,其他的(例如问号)会截断其后的所有文本。这是一个例子,我有一个类似于此的端点设置publicclassFeedbackDTO{publicboolpostResult{get;set;}}[Route("/feedback","POST")][Route("/feedback/{uuid}/{content}","POST")]publicclassGiveFeedback:IR