Tag: xamarin.ios

iOS从本地通知打开页面

我目前使用UNUserNotificationCenter在OS10的指定时间发出本地通知。 我试图找出当用户点击本地通知时如何在我的应用程序中打开特定的页面。 任何人如何做到这一点我真的很新,在C#编程的iOS,我敢肯定它并不罕见的事情要做。

ping在monotouch

我想知道为什么一些monotouchfunction在模拟器中运行良好,但在真实设备上失败? 相同的Ping类。 它从模拟器完美工作,但在设备上失败。 有什么不同? 有没有办法让它在设备上工作? 另外,我已经find了关于如何在mac OS中实现ping的文章: http : //developer.apple.com/library/mac/#samplecode/SimplePing/Listings/SimplePing_m.html#//apple_ref/doc/uid / DTS10000716-SimplePing_m-DontLinkElementID_5 有可能将这个代码移植到monotouch? 说实话,我还没有尝试,如果它在iOS上工作,但我没有看到任何东西,为什么它不会在那里工作。 PS。 我知道Reachability类,是的,我使用它在我的项目,而不是平!

在iOS iOS Xamarin上更改背景

我正在构build一个iOS应用程序,我试图每隔几秒更改背景图片。 我使用这里的代码设置了一个计时器: https : //developer.xamarin.com/api/type/System.Threading.Timer/ 我的代码如下所示: using System; using System.Threading; using UIKit; namespace TestApp { public partial class ViewController : UIViewController { // New Timer class BackgroundTimer { public int counter = 0; public Timer tmr; } // Load screen public override void ViewDidLoad() { base.ViewDidLoad(); BackgroundTimer s = new BackgroundTimer(); // Create the delegate […]

从IntPtr创buildNSException

我指的是这个post : private static void MyUncaughtExceptionHandler(IntPtr exception) { // this is not working because NSException(IntPtr) is a protected constructor var e = new NSException(exception); // … } 我如何在这里创build一个exception? 我应该这样做吗? NSException exception = (NSException)ObjCRuntime.Runtime.GetNSObject(handle);

从Xamarin.iOS中的TableView Cell以编程方式推入一个segue

我正在用Xamarin开发一个相当简单的应用程序,但是我陷入了一件事:我在UIViewController中创build了一个tableView。 单元格渲染是在外部类中完成的:TableSource.cs。 UITableViewSource的一个子类。 处理行单击我重写行select: public override void RowSelected (UITableView tableView, NSIndexPath indexPath) { new UIAlertView("Row Selected", tableItems[indexPath.Row], null, "OK", null).Show(); tableView.DeselectRow (indexPath, true); // iOS convention is to remove the highlight //Push another ViewController on top: UINavigationController test = new UINavigationController (); test.PushViewController (new UIViewController (),true); } 像迄今为止的魅力。 但是当我尝试推顶另一个ViewController,显示关于该行的详细数据,只是没有任何反应,我没有得到任何错误或exception消息。 我也用导航的自定义类来尝试它。 控制器和视图控制器,它不会改变任何东西。

在填充UITableViewController时,自定义单元格中的标签为null

我使用Xamarin.iOS来构build一个iOS应用程序。 我正在使用故事板,并创build了一个使用自定义单元格的分组表创build一个UITableViewController 。 单元格包含我要为其分配值的标签。 覆盖数据源中的getcell方法来设置标签的文本属性抛出一个空的exception,我找不到为什么? 我检查了出口,它在那里。 任何提示如何find错误? public partial class NameListScreen : UITableViewController { MyTableSource _source = null; public override void ViewWillAppear (bool animated) { base.ViewWillAppear (animated); LoadNameList(); } void LoadNameList () { var service = new MyService(); var names = service.GetAllNames(); _source = new MyTableSource(names); this.TableView.Source = _source; } } public class MyTableSource : […]

Xamarin Ios – 仅在一侧创build圆形button

我目前正在为Xamarin Ios开发一个应用程序,并且我正在努力寻找一种方法来将UButtontypes的button应用于简单的一侧。

Xamarin:UICollection图像重新sorting问题

我正在使用UICollectionView来存储图像,我可以通过重写CanMove和MoveItem来重新排列它们。 但是UICollection里面的项目只有在单元大小很大的时候才会重新sorting,就像单元格大小在106左右的高度和宽度一样,如果它们的大小较小,它们可以重新sorting,它们不能被重新sorting。 视图: public override void ViewDidLoad() { base.ViewDidLoad(); //ImageCv is the name of UiCollectionView var collectionLayout = new PostImageFlowLayout(3, 0.85f); var allCollectionSource = new PostImageColectionSource(ImageCv, (ViewModel as NewPostDetailViewModel)); ImageCv.RegisterNibForCell(PostImageCell.Nib, PostImageCell.Key); ImageCv.RegisterClassForSupplementaryView(typeof(CollectionHeader), UICollectionElementKindSection.Header, new NSString("headerId")); ImageCv.BackgroundColor = UIColor.Clear; ImageCv.Hidden = false; ImageCv.DataSource = allCollectionSource; ImageCv.Delegate = collectionLayout; var longPressGesture = new UILongPressGestureRecognizer(gesture => { // […]

该可执行文件仅在设备上签有无效授权错误

我在Xamarin中创build了一个iPhone应用程序。 我已经在Entitlements.plist中启用了KeyChain共享,这样我就可以在类似的应用程序中共享一些数据。 该应用程序在模拟器上正常工作和debugging。 但是,当我使用开发或分发供应configuration文件签署应用程序时,应用程序不会部署在设备上。 如果我禁用KeyChain共享应用程序工作正常。 我得到这样的错误: Info (216) / streaming_zip_conduit: _dispatch_source_read_socket_block_invoke:312: Failed to install application at file:///var/mobile/Media/PublicStaging/appname.iOS.app/ : Error Domain=MIInstallerErrorDomain Code=13 "Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.VEgA0a/extracted/Poll365.iOS.app : 0xe8008016 (The executable was signed with invalid entitlements.)" UserInfo={LibMISErrorNumber=-402620394, LegacyErrorString=ApplicationVerificationFailed, SourceFileLine=147, FunctionName=+[MICodeSigningVerifier validateSignatureAndCopyInfoForURL:withOptions:error:], NSLocalizedDescription=Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.VEgA0a/extracted/appname.iOS.app : 0xe8008016 (The executable was signed […]

Xamarin.Forms ZXing.Net.Mobile在iOS 10上扫描结果后丢失当前页面

我正在使用Xamarin.Forms,我已经实现了ZXing.Net.Mobile扫描条形码。 在Android上它工作正常,在iOS 10上读取条形码后,会触发函数“OnScanResult”并执行closures扫描页面的命令Navigation.PopAsync(),但是在closures之后,它也closures当前显示结果的页面! MyTapScan.Tapped += async (sender, e) => { await MyBtScan.ScaleTo(1.20, 100, Easing.Linear); await MyBtScan.ScaleTo(1, 100, Easing.Linear); await Task.Delay(50); //——————————————– MyAppLib.MyAppUtilitiesBarCodeReader MyBarCodeReader = new MyAppLib.MyAppUtilitiesBarCodeReader(); var MyScannerPage = MyBarCodeReader.GetBarCodeReaderPage(); //——————————————– MyScannerPage.OnScanResult += (result) => { //Stop scanning MyScannerPage.IsScanning = false; //Pop the page and show the result Device.BeginInvokeOnMainThread(() => { Navigation.PopAsync(); MyMachSerialNumber.Text = result.Text; […]