问题
I have an ios App created in Xamarin with Visual Studio on the Mac. I've modified SceneDelegate to load a UITabController that is not created on the Storyboard. I've done this to allow changing the number of tabs presented in some cases.
The UITabController is adding a View that is defined on the Storyboard. This view contains a TextField, this textfield does not allow text entry. When you tap it a keyboard does not appear.
Yes User Interaction Enabled is checked.
How can I fix this? Thanks, Gerry
回答1:
We need to assign the UIScene (actually a UIWindowScene) to the WindowScene property of the Window , so improve the code in SceneDelegate.WillConnect like following :
Window = new UIWindow(scene as UIWindowScene);
UIViewController vc = new MyTabController();
Window.RootViewController = vc;
Window.MakeKeyAndVisible();
来源:https://stackoverflow.com/questions/60677120/textfield-in-xamarin-ios-not-allowing-input