TextField in Xamarin IOS not allowing input

时光怂恿深爱的人放手 提交于 2020-03-28 06:53:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!