Tag: xamarin.ios

我们需要在iOS中制作dynamic视图高度的约束条件

因为我是iOS新手。 所以请原谅,如果是重复或非常基本的问题。 我正在采取一个视图。 大约在下面是大小。 x : 5 y : 5 Width : 590 Height : 100 我设置约束它 Top to superView 5 Trailing to superView 5 Leading to superView 5 现在我有一个有dynamic文本和文本太大的标签。 下面是标签约束 Top to superView 5 Trailing to superView 5 Leading to superView 5 当我设置的背景颜色的查看颜色没有设置。 如果文本是很长的。 所以如何设置视图的高度,并设置背景,使其看起来很清晰。 代码: public override void ViewDidLoad() { base.ViewDidLoad(); lbl_one.Text = […]

Xamarin绑定在设备上失败,但在模拟器中工作

我创build了一个带有一个函数的Objective-C库。头文件被定义为: @interface StarIOFunctions : NSObject { } + (NSMutableData *) GetDataToSendToPrinter:(UIImage *)image maxWidth:(int)maxWidth drawerKick:(BOOL)drawerKick compressionEnable:(BOOL)compressionEnable; @end 我为它创build了一个绑定: [BaseType (typeof (NSObject))] interface StarIOFunctions { [Static, Export ("GetDataToSendToPrinter:maxWidth:drawerKick:compressionEnable:")] NSMutableData GetDataToSendToPrinter (UIImage image, int maxWidth, bool kickDrawer, bool compressionEnable); } 而通过它的呼吁: image = UIImage.FromBundle("barcode.png"); NSMutableData commandsToPrint = StarIOFunctions.GetDataToSendToPrinter(image,576,true,true); 所有在模拟器中工作正常,但是当我释放到设备的应用程序崩溃,当它试图调用具有以下错误的函数: 2014-09-30 19:10:52.776 DemoApp[280:26219] +[StarIOFunctions GetDataToSendToPrinter:maxWidth:drawerKick:compressionEnable:]: unrecognized selector sent to […]

如何在Xamarin iOS中使用蓝牙低功耗协议发布制造商特定的数据?

我需要在Xamarin iOS中使用蓝牙低能量协议广播包含特定制造商特定数据的广告数据包。 我能够广播广告数据包,但收到时不包含制造商特定的数据。 它们包含我设置的本地名称和数据服务UUID键。 我应该提到在Xamarin中这样做Android不是问题。 你能告诉我为什么制造商的具体数据不在Xamarin iOS中播放? 我正在使用下面的代码: using CoreBluetooth; namespace XamarinBt { public class BluetoothOperations { CBPeripheralManager cbPeriphMang = new CBPeripheralManager(); public void AdvertiseData() { var uui = new CBUUID[] { CBUUID.FromString("E20A39F4-73F5-4BC4-A12F-17D1AD07A961") }; var nsArray = NSArray.FromObjects(uui); var nsObject = NSObject.FromObject(nsArray); var manufacturerDataBytes = new byte[6] { 5, 255, 76, 0, 25, 35 }; […]

下载并将ios 5模拟器添加到xcode 4.5中,并在没有xcode组件的情况下单击

我想下载和安装ios模拟器5在我的Xcode和monotouch。 我知道我们可以通过安装ios模拟器5或5.1来从xcode组件中添加它,但是我的这些天我的互联网连接是疯狂的:(它断开连接,也是在xcode组件上。 是否有任何机构有手动下载模拟器的链接,并将其添加到Xcode和单触离线?

Visual Studio for Mac:Guid应该包含32个数字(4个破折号)(xxxx …)

我是一个适用于Mac的Visual Studio的菜鸟。 我的目的是检查Xamarin发展。 我的Visual Studio版本是7.3(Build 799)社区版,我已经安装在MB Pro 2015 Mid模型上。 当我尝试按照以下方式创build项目时, 多 应用 游戏(iOS,Mac) SpriteKit游戏(2D) 然后继续执行步骤,直到按下创buildbutton给出项目名称,所有它只是给我以下警报,我不能创build该项目。 更新:我通过转到“打开日志目录”菜单项find以下日志。 ERROR [2017-12-14 00:46:07Z]: The project could not be created System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). at System.Guid+GuidResult.SetFailure (System.Guid+ParseFailureKind failure, System.String failureMessageID, System.Object failureMessageFormatArgument, System.String failureArgumentName, System.Exception innerException) [0x00034] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/guid.cs:200 at System.Guid+GuidResult.SetFailure (System.Guid+ParseFailureKind failure, System.String […]

如何捕获MonoTouch中的UIWebView错误?

下面是目标C中类似问题的答案 ,但我不确定将其转换为MonoTouch的正确方法。 基本上,我希望能够抓住JavaScript错误,至less知道文件名和行号 – 不幸的是, window.onerror并没有给出这个重要的信息。 特别是,我不确定是否应该公开一个本地库,或者如果我可以写在纯粹的MonoTouch中。

为什么我不能使HttpWebRequest使用NTLM身份validation

我正在尝试从MonoTouch中调用EWS,如下面的代码片段所示: byte[] bytes = Encoding.UTF8.GetBytes("… some xml here …"); HttpWebRequest req = WebRequest.Create("https://owa.site.com/ews/exchange.asmx") as HttpWebRequest; req.Method = "POST"; req.KeepAlive = true; req.ContentType = "text/xml"; req.ContentLength = bytes.Length; req.AuthenticationLevel = AuthenticationLevel.MutualAuthRequested; CredentialCache ch = new CredentialCache(); ch.Add(req.RequestUri, "Negotiate", new NetworkCredential("uname", "pwd", "domain")); req.Credentials = ch; Stream sreq = req.GetRequestStream(); sreq.Write(bytes, 0, bytes.Length); sreq.Close(); WebResponse resp = […]

无法复制苹果iOS应用程序审查崩溃

我最近将我的iOS应用程序提交给Apple进行审查。 它是用C#编写的,使用Xamarin iOS,Monotouch和Monogame。 我使用Xamarin IDE进行开发。 一个星期后,我收到一个拒绝,指出当审阅者试图访问应用程序内购买商店时,应用程序在iPad上崩溃的原因,而在iPhone 5s上,它不会崩溃,但表明它不能到达Apple服务器以检索商店物品。 我的商店大部分检索代码是从这里find的Xamarin指南。 问题是我无法复制这些崩溃。 商店打开我很好,我广泛的testing。 我testing了所有的模拟器,以及debugging和发布configuration中的许多真实设备(iPhone 4,iPhone 5,iPhone 5s,iPad第三代)。 我没有在ad-hoc模式下进行testing,因为这些设备中的很多都是从我的朋友那里借来的,我不想在iTunes中同步,因为这可能会清除设备数据。 所以我希望发布版本和特设的等同于find审查小组的bug。 至于苹果给我的崩溃日志,他们没有帮助我,因为大多数的行都没有在Xcode中使用我提交给苹果公司的相同的存档文件进行正确的符号化。 日志中有很多'__lldb_unnamed_function'行。 所有我能够告诉的是,试图检索商店时发生了崩溃。 因此,我坚持不知道下一步该做什么。 build议表示赞赏。 以下是长期崩溃日志的最后部分。 Incident Identifier: 24777CEA-21FF-434B-A658-BFB4BC89F7B2 CrashReporter Key: e981dd69858f1d35ba231cd2e288f3d33625919f Hardware Model: xxx Version: 1 (1) Code Type: ARM (Native) Parent Process: launchd [1] Date/Time: 2014-01-09 13:30:21.579 -0800 OS Version: iOS 7.0.4 (11B554a) Report Version: 104 Exception […]

iOS黑屏和MissingMethodException:未find方法:'System.Type.op_Equality'

我开始使用MvvmCross创build一个应用程序。 到目前为止,我有一个适用于Android和WP运行的版本。 不幸的是,为iOS创build应用程序并不容易。 在模拟器中运行iOS应用程序时,我只能看到一个黑屏。 在MonoDevelop的应用程序输出中看到以下exception: 2013-01-07 10:42:20.506 BestSellersTouch[319:21e03] mvx: Diagnostic: 0.09 Exception masked MissingMethodException: Method not found: 'System.Type.op_Equality'. at Cirrious.MvvmCross.Touch.Views.Presenters.MvxTouchViewPresenter.CreateView (Cirrious.MvvmCross.Views.MvxShowViewModelRequest request) [0x00000] in <filename unknown>:0 at Cirrious.MvvmCross.Touch.Views.Presenters.MvxTouchViewPresenter.Show (Cirrious.MvvmCross.Views.MvxShowViewModelRequest request) [0x00000] in <filename unknown>:0 at Cirrious.MvvmCross.Touch.Views.MvxTouchViewDispatcher+<>c__DisplayClass4.<RequestNavigate>b__3 () [0x00000] in <filename unknown>:0 at Cirrious.MvvmCross.Touch.Views.MvxTouchUIThreadDispatcher+<>c__DisplayClass1.<InvokeOrBeginInvoke>b__0 () [0x00000] in <filename unknown>:0 2013-01-07 10:42:20.508 BestSellersTouch[319:21e03] Application windows are expected […]

MonoTouch:SQLite-net线程安全和SQLiteConfig.Serialized

我想通过调用这样的代码使SQLite默认为“更多”线程安全: SqliteConnection.SetConfig (SQLiteConfig.Serialized); 我认为这涉及到设置: DSQLITE_THREADSAFE=1 但如何做到这一点也是一个谜。 使用真棒SQLite-NET的ORM的MonoTouch,似乎没有办法设置SQLiteConfig.Serialized? 想法?