Tag: xamarin

对象引用未设置为单点触摸中的对象的实例

NavigationController当我想从一个页面导航到另一个页面时,input空参数。 这是我的代码: var detail = Viewcontroller.Storyboard.InstantiateViewController("FullgalleryimagesStoryBoardId") as fullgalleryimageinfo; Viewcontroller.NavigationController.PushViewController (detail, true); Viewcontroll和storyboard正确地使用参数,但是NavigationController会抛出一个像上面那样的exception 我能做什么? try { UINavigationController Navigationcontroller=new UINavigationController(); var detail = Viewcontroller.Storyboard.InstantiateViewController("FullgalleryimagesStoryBoardId") as fullgalleryimageinfo; // Viewcontroller.NavigationController.PushViewController (detail, true); Navigationcontroller.PushViewController(detail,true); } catch (Exception ex) { string exep=ex.Message; } 我试过这个代码片段没有例外,但没有页面导航完成。

如何在tvOS上显示GameCenter排行榜?

我想我遵循了所有必要的步骤来支持我的游戏中的排行榜(并且他们在iOS上工作得很好),但是在tvOS上,不能configurationGKGameCenterViewController来显示特定的排行榜, LeaderboardIdentifier属性只是简单的丢失ViewState ): var leaderboardController = new GKGameCenterViewController (); // Unavailable on tvOS /* leaderboardController.ViewState = GKGameCenterViewControllerState.Default; leaderboardController.LeaderboardIdentifier = "myLeaderboardId"; */ leaderboardController.Finished += (sender, e) => { leaderboardController.DismissViewController (true, null); } PresentViewController (leaderboardController, true, null); 我没有使用这些属性,而是按照这里的说明。 我注意到这将在最终的应用程序包中生成一个GKGameCenterContent.plist文件。 我仔细检查了内容: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>GKLeaderboards</key> <array> <dict> <key>identifier</key> […]

Monotouch.Dialog和iAds

我正在玩iAds。 我想将它添加到基本上是一堆Monotouch.Dialog视图的应用程序。 添加一个UIViewController ,然后添加一个ADBannerView和一个Monotouch.Dialog ,或者我应该添加iAds视图到Monotouch.Dialog ViewController?

是否有可能在iOS 7或iOS 8模拟器中使用NSUbiquitousKeyValueStore?

我正在testing使用iCloud键值存储的应用程序。 一切正在物理设备上工作,但键值存储不保存任何使用模拟器。 从我所了解的基于这个文件的文件来看,iCloudtesting在模拟器上是可行的,这应该是可行的。 (顺便说一下,我已经在模拟器上configuration了iCloud) 我用下面的代码使用Xamarin / Monotouch: var store = NSUbiquitousKeyValueStore.DefaultStore; store.SetString ("TestKey", "test123"); store.Synchronize (); 当以后或之后立即读取值时,该值始终为空。 var store = NSUbiquitousKeyValueStore.DefaultStore; var testValue = store.GetString ("TestKey"); //*** testValue always null using the simulator *** 是否有可能在iOS模拟器中testingiCloud的键值存储?

你可以检测到一个UIViewController被解散或popup?

我有一些清理,需要在一个共享资源执行任何时候我的视图控制器之一被解散/popup/卸载? 这可以是用户点击单个屏幕上的后退button,或者调用popToRootViewController(在这种情况下,理想情况下,我可以清除每个popup的控制器)。 显然的select是在viewDidUnload中做到这一点,但当然,这不是如何卸载工程。 有没有办法将所有的情况都捕获到ViewController从堆栈中删除? 编辑:忘了提及,我正在使用Xamarin这样做,可能会或可能不会影响的答案。

如何在Xamarin中以编程方式触发UIButton的TouchUpInside ios C#

我正尝试以编程方式触发Uibutton的touchupinside事件。 我怎样才能做到这一点 ? 我尝试的代码使用PerformSelector,但我得到这个错误 "Error MT4117: The registrar found a signature mismatch in the method 'VCPAckage2.ActivityViewController.TouchUpInsideEvent' – the selector 'TouchUpInsideEvent:' indicates the method takes 1 parameters, while the managed method has 2 parameters. " 我想达到类似的东西 UIButton.FireEvent("TouchUpInsideEvent") – this will fire the TouchUpInsideEvent UIButton.PerformSelector(new MonoTouch.ObjCRuntime.Selector ("TouchUpInsideEvent:"), null, 2000f); 这是代码 private void LoadFn() { UIButton btnSubmit = […]

显示根视图控制器后的黑屏,只有在inheritancePayPalPaymentDelegate时

问题是, 只有在inheritance了PayPalPaymentDelegate的类时,才会在启animation面后显示黑屏。 在第一次,我认为这是我的PayPalMobile绑定,所以我用这个由Alejandro PayPalMobile绑定 。 我通过使用他的绑定和我得到了相同的结果。 我运行Alejandro示例应用程序 ,它完美的作品。 我不知道为什么我要弄到我的黑屏。 什么可能导致我的项目这个问题? 我到目前为止所做的: 我将部署目标从8.4更改为9.2,将主界面从none更改为LoginViewController,并收到相同的问题。 做了一个新的解决scheme,添加了我的PayPalMobile绑定,它的工作。 在进入黑屏之前,根视图控制器会显示出来。 所以,有些东西在解决scheme中导致了我无法弄清楚的问题。 环境: 我正在使用最新的PayPalMobile 使用Xamarin Studio 5.10.2 使用iPhone 6s 9.2模拟器 的Info.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDisplayName</key> <string>Test</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleVersion</key> <string>1.0</string> <key>LSRequiresIPhoneOS</key> <true/> <key>MinimumOSVersion</key> <string>9.2</string> <key>UIDeviceFamily</key> <array> <integer>1</integer> </array> <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> <key>UIRequiredDeviceCapabilities</key> <array> […]

更新xCode / Xamarin后,我得到一个MT5306错误时build立

更新我的Xamarin / Xcode后,我不断收到以下错误:“无法创build一个胖文件,请检查生成日志(MT5306)。

没有findXamarin方法'CGSize..ctor'

我只是更新了xamarin工作室,然后在我的iOS项目中的xamarin.forms包。 这一切都build立好,但是当我尝试在模拟器中运行的应用程序,我得到以下错误: 找不到方法“CGSize..ctor”。 我创build了一个新的解决scheme build立并运行两个工作正常。 但后来我更新了新解决scheme中的xamarin.forms包。 同样的错误再次出现。 所以看起来好像新的软件包已经推出是错误的。 我们什么时候可以期待一个修补程序和一个新的xamarin.forms包的推出?

如何检查表中存在的数据库sqlite的Xamarin iOS

如何检查在db数据库中是否创build表。 var folder = Environment.GetFolderPath (Environment.SpecialFolder.Personal); SQLiteConnection db = new SQLiteConnection (System.IO.Path.Combine (folder,"note.db")); try{ var existTable = db.Query<TransationTable>("SELECT count(*) FROM sqlite_master WHERE type = 'Table' AND name = 'TransationTable' "); Console.WriteLine ("Count {0}",existTable.Count); if(existTable.Count == 0){ tableview.Hidden = true; lbl_NotFound.Hidden = false; } else{ tableview.Hidden = false; lbl_NotFound.Hidden = true; } } catch{ Console.WriteLine ("Calling […]