Typed characters are not showing on textboxes on IOS app made with Xamarin

I have a strange problem with typed characters are not showing on textboxes on IOS app made with Xamarin.

I dont have an Iphone and i test the app on the simulator where is working fine.

First time published the app its rejected because of this. I cleared and builded again, published and its passed.

Now i have complains from some users, not all, that when they type at the textboxes the characters are not showing.

Do you have any idea why this happening?

Tagged:

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    Which sort of controls are you using to display the input(UITextField or UITextView)?
    Did you write some delegates to avoid the input?
    Please share a repo here to help us reproduce this issue on my side.

  • The user can type. The problem is that the characters are not appearing.
    I am sending you the code

    var formGroup = new UIStackView
    {
    TranslatesAutoresizingMaskIntoConstraints = false,
    Axis = UILayoutConstraintAxis.Vertical,
    Alignment = UIStackViewAlignment.Fill,
    Distribution = UIStackViewDistribution.Fill,
    Spacing = 10
    };

            _userNameTF = new UITextField(new CGRect(0, 0, 200, 50))
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = UIColor.White,
                BorderStyle = UITextBorderStyle.RoundedRect,
                Placeholder = "Telephone ",
                KeyboardType = UIKeyboardType.NumberPad
            };
            formGroup.AddArrangedSubview(_userNameTF);
    
            _passwordTF = new UITextField(new CGRect(0, 0, 200, 50))
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = UIColor.White,
                BorderStyle = UITextBorderStyle.RoundedRect,
                Placeholder = "Code",
                //                SecureTextEntry = true,
                KeyboardType = UIKeyboardType.NumberPad
            };
            formGroup.AddArrangedSubview(_passwordTF);
    
            var dummySpaceView = new UIView
            {
                TranslatesAutoresizingMaskIntoConstraints = false
            };
    
            formGroup.AddArrangedSubview(dummySpaceView);
    
            var submitBtn = new UIButton
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = UIColor.FromRGB(166, 150, 121),
                TintColor = UIColor.White,
            };
            submitBtn.Layer.CornerRadius = 5;
            submitBtn.SetTitle("Log In", UIControlState.Normal);
    
  • LandLuLandLu Member, Xamarin Team Xamurai

    We should avoid using the frame on a child in UIStackView. The UIStackView will automatically arrange its children depending on the Alignment, Distribution and Spacing. So here is my UIStackView:

    var formGroup = new UIStackView
    {
        TranslatesAutoresizingMaskIntoConstraints = false,
        Axis = UILayoutConstraintAxis.Vertical,
        Alignment = UIStackViewAlignment.Fill,
        Distribution = UIStackViewDistribution.Fill,
        Spacing = 10
    };
    View.AddSubview(formGroup);
    formGroup.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor).Active = true;
    formGroup.TopAnchor.ConstraintEqualTo(TopLayoutGuide.GetBottomAnchor()).Active = true;
    formGroup.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor).Active = true;
    formGroup.BottomAnchor.ConstraintEqualTo(BottomLayoutGuide.GetTopAnchor()).Active = true;
    
    _userNameTF = new UITextField
    {
        BackgroundColor = UIColor.White,
        BorderStyle = UITextBorderStyle.RoundedRect,
        Placeholder = "Telephone ",
        KeyboardType = UIKeyboardType.NumberPad
    };
    formGroup.AddArrangedSubview(_userNameTF);
    
    _passwordTF = new UITextField
    {
        BackgroundColor = UIColor.White,
        BorderStyle = UITextBorderStyle.RoundedRect,
        Placeholder = "Code",
        //                SecureTextEntry = true,
        KeyboardType = UIKeyboardType.NumberPad
    };
    formGroup.AddArrangedSubview(_passwordTF);
    
    var dummySpaceView = new UIView();
    formGroup.AddArrangedSubview(dummySpaceView);
    
    var submitBtn = new UIButton
    {
        BackgroundColor = UIColor.FromRGB(166, 150, 121),
        TintColor = UIColor.White,
    };
    submitBtn.Layer.CornerRadius = 5;
    submitBtn.SetTitle("Log In", UIControlState.Normal);
    formGroup.AddArrangedSubview(submitBtn);
    

    It worked on my side and could you please post the steps about how to reproduce this issue?

Sign In or Register to comment.