I want to display a dialog in iOS and add a UITextView
to the view of the dialog. The UITextView
textView has text with clickable links for email,phone and url. I am able to trigger the dialog but only with the title and an ok button. There is no textview being added to the dialog view. I am not sure if the issue here is with the textview or with the way the view is being added to the dialog.
Please check my code below:
UITextView textView = new UITextView();
textView.Editable = false;
textView.DataDetectorTypes = UIDataDetectorType.All;
textView.Message = message;
var dlg = UIAlertController.Create(Title ?? String.Empty, null, UIAlertControllerStyle.Alert);
dlg.View.AddSubview(textView);
dlg.AddAction(UIAlertAction.Create(OkText, UIAlertActionStyle.Default, action => Submit()));
var top = Utils.GetTopViewController();
top.PresentViewController(dlg, animated: true, completionHandler: null);
Thanks,
This is how you can add a UITextField in a UIAlertViewController
I hope this helps
Seems like you need a custom popup view to finish what you need, I write a sample for you, this is the code:
This is the ViewController.cs:
And this is the CustomPopUpView.cs:
You can just add anything you want to this CustomPopUpView, or you can inherit it and create your own popup.
Hope it can help you.