private void createDefaultTextField () { textfield = new UITextField(new CGRect(10, 10, 100, 50)); //Parameters // Setting parameters textfield.setKeyboardType(UIKeyboardType.Default); textfield.setReturnKeyType(UIReturnKeyType.Done); textfield.setAutocapitalizationType(UITextAutocapitalizationType.None); textfield.setAutocorrectionType(UITextAutocorrectionType.No); textfield.setSpellCheckingType(UITextSpellCheckingType.No); textfield.setHidden(true); // Text field needs to have at least one symbol - so we can use backspace textfield.setText("x"); app.getUIViewController().getView().addSubview(textfield); }
private void createDefaultTextField () { textfield = new UITextField(new CGRect(10, 10, 100, 50)); //Parameters // Setting parameters textfield.setKeyboardType(UIKeyboardType.Default); textfield.setReturnKeyType(UIReturnKeyType.Done); textfield.setAutocapitalizationType(UITextAutocapitalizationType.None); textfield.setAutocorrectionType(UITextAutocorrectionType.No); textfield.setSpellCheckingType(UITextSpellCheckingType.No); textfield.setHidden(true); // Text field needs to have at least one symbol - so we can use backspace textfield.setText("x"); app.getUIViewController().getView().addSubview(textfield); }
private void createDefaultTextField () { textfield = new UITextField(new CGRect(10, 10, 100, 50)); //Parameters // Setting parameters textfield.setKeyboardType(UIKeyboardType.Default); textfield.setReturnKeyType(UIReturnKeyType.Done); textfield.setAutocapitalizationType(UITextAutocapitalizationType.None); textfield.setAutocorrectionType(UITextAutocorrectionType.No); textfield.setSpellCheckingType(UITextSpellCheckingType.No); textfield.setHidden(true); // Text field needs to have at least one symbol - so we can use backspace textfield.setText("x"); app.getUIViewController().getView().addSubview(textfield); }
@Override public void show() { alertWindow.makeKeyAndVisible(); alertWindow.getRootViewController().getView().addSubview(this); Platform.getPlatform().runOnUIThread(() -> { setTransform(CGAffineTransform.Identity().concat(CGAffineTransform.createScale(0.5, 0.5))); isShown = true; UIView.animate(0.3, () -> { setAlpha(1); setTransform(CGAffineTransform.Identity()); }); }); }
public Rectangle getSafeAreaInsets() { if (Foundation.getMajorSystemVersion() < 11) { return rectangle; } else { UIView view = UIApplication.getSharedApplication().getKeyWindow().getRootViewController().getView(); UIEdgeInsets edgeInsets = view.getSafeAreaInsets(); double top = edgeInsets.getTop() * view.getContentScaleFactor(); double bottom = edgeInsets.getBottom() * view.getContentScaleFactor(); double left = edgeInsets.getLeft() * view.getContentScaleFactor(); double right = edgeInsets.getRight() * view.getContentScaleFactor(); rectangle.set((float) left, (float) bottom, (float) right, (float) top); return rectangle; } }
textfield.setText(""); textfield.setSecureTextEntry(false); ((IOSApplication)Gdx.app).getUIViewController().getView().addSubview(textfield); break; case setTextFieldListener: