Tag: xamarin.ios

在xamarin中启用ARC

大多数安全和渗透工具都会报告ARC是否未启用。 fobjc-arc flag is not Found 据我所知,我们不能在xamarin中这样做,因为我们这里没有构建设置。 此标志只能在构建设置中设置。 即使我们可以,它也行不通,因为xamarin使用C#和MRC来自行管理内存。 任何人都可以解释我如何做或不做或我的理解是错误的 编辑: 我们可以通过构建设置将ARC打开为完整项目 CLANG_ENABLE_OBJC_ARC=YES 但是在xam studio中无法做到这一点…在mtouch中设置值也会引发错误

适用于iphone应用的MonoTouch和C#VS Objective C.

问候,我是一名C#程序员。 我打算开始为iphone开发应用程序但是我不确定我是否应该在MonoTouch下使用C#或者只是使用iphone OS的本地语言Objective C. 使用C#或Objective C的iphone应用程序有不同的程序吗? 使用C#为iphone编程应用程序是否存在限制,或者它可以像Objective C那样开发iphone应用程序吗?

在IOS上使用mvvmcross绑定的问题(在模拟器上工作,但某些属性在设备上不起作用)

问题在于绑定到UIBarButtonItem,代码在Simulator上工作,但在设备上属性Enable不起作用,Clicked Works … textViewItem中存在同样的问题,但这次text或enable都不起作用。 public partial class ProcessDetailViewController : MvxBindingTouchViewController { public ProcessDetailViewController (MvxShowViewModelRequest request) : base (request,”ProcessDetailViewController”, null) { } public override void DidReceiveMemoryWarning () { // Releases the view if it doesn’t have a superview. base.DidReceiveMemoryWarning (); // Release any cached data, images, etc that aren’t in use. } public override void ViewDidLoad […]

Xamarin – 从base64字符串显示图像

我是Xamarin和XAML的新手,这是我迄今为止在Android和iPhone使用的便携式项目中所做的事情(仅使用Android): Item.cs(从JSON加载) [JsonProperty(“image”)] private string ImageBase64 { get; set; } [JsonIgnore] private Xamarin.Forms.Image _image = null; [JsonIgnore] public Xamarin.Forms.Image Image { get { if (_image == null) { _image = new Xamarin.Forms.Image() { Source = Xamarin.Forms.ImageSource.FromStream(() => new MemoryStream(Convert.FromBase64String(ImageBase64))), BackgroundColor = Color.White, WidthRequest = 64, HeightRequest = 64, }; OnPropertyChanged(“Image”); } return _image; } private […]

自定义函数SQLite与Mono

有没有办法使用Mono添加SQLite自定义函数? (Mono.Data.Sqlite) 我尝试添加距离函数,返回两个地理位置之间的距离 [SqliteFunctionAttribute(Name = “distance”, Arguments = 4, FuncType = FunctionType.Scalar)] class SqliteDistance : SqliteFunction { public override object Invoke(object[] args) { double radius = 6367; double lat1 = System.Convert.ToDouble(args[0]); double lng1 = System.Convert.ToDouble(args[1]); double lat2 = System.Convert.ToDouble(args[2]); double lng2 = System.Convert.ToDouble(args[3]); return radius * 2 * Math.Asin( Math.Min(1, Math.Sqrt( ( Math.Pow(Math.Sin((lat2* (Math.PI / […]

解析JSON.net中的枚举

我正在使用JSON.net(也许v3.5ish?它来自2010年10月)。 我试图将一些json反序列化为枚举: geometryType:“esriGeometryPolygon” 我有这个枚举: /// /// The geometry type. /// [DataContract] public enum GeometryType { /// /// Refers to geometry type Envelope /// [EnumMember(Value = “esriGeometryEnvelope”)] Envelope, /// /// Refers to geometry type MultiPoint /// [EnumMember(Value = “esriGeometryMultipoint”)] MultiPoint, /// /// Refers to geometry type MapPoint /// [EnumMember(Value = “esriGeometryPoint”)] Point, /// /// Refers to […]

Monocross和Monotouch(xamarin)之间的区别?

我现在正在探索Monotouch(Xamarin)与其他解决方案(如Monocross)的function吗? 所以任何人都可以解释何时使用Monotouch以及何时使用Monocross。 这些框架与本机应用程序开发的优点和缺点是什么?

如何在Xaml文件中的Xamarin.Forms中添加Checkbox?

我是xamarin.forms的新手,我需要添加一个复选框,单选按钮和下拉列表。 我从网上尝试了一些样本,但我无法获得复选框。 任何人都可以帮助我在xamarin.forms中实现这一目标吗? Xaml文件 要么 一些链接或示例代码将使其更容易理解。

将UIImage转换为字节数组

我需要将UIImage转换为字节数组。 我正在使用Xamarin的Visual Studio插件来生成iOS应用程序。 下面的代码位获取图像,但我需要将其作为字节数组而不是UIImage发送到服务堆栈。 var signatureView = new SignaturePad.SignaturePadView(new RectangleF(10, 660, 300, 150)); signatureView.BackgroundColor = UIColor.White; this.View.AddSubview(signatureView); UIImage signatureImage = signatureView.GetImage();

在Xamarin.Forms中编写设备平台特定代码

我有以下Xamarin.Forms.ContentPage类结构 public class MyPage : ContentPage { public MyPage() { //do work to initialize MyPage } public void LogIn(object sender, EventArgs eventArgs) { bool isAuthenticated = false; string accessToken = string.Empty; //do work to use authentication API to validate users if(isAuthenticated) { //I would to write device specific code to write to the access token […]