Android Question EditText width shrinks when Keyboard appears

walterf25

Expert
Licensed User
Hi all, i was wondering if anyone has seen this issue before, this is the first time I see it for sure, for some reason the width of every edittext control shrinks when i click on any of them and the keyboard appears, i don't have anything special in the layout script that would cause this issue or in my code during run time, the only thing I have in my code is the following to create a border around each edittext and create round corners.

Any idea why this is happening, at first I thought this was an issue with the ACEditText controls, so I changed to the native EditText control, but i am seeing the same issue.

Take a look at the small video i made to show the issue.

I am using B4A v10.2 and a Galaxy S10 plus device running Android 10.

Walter
 
Last edited:

walterf25

Expert
Licensed User
Seems like the problem is with this code:
B4X:
    Dim cd2 As ColorDrawable
    cd2.Initialize2(Colors.white, 12dip, 1dip, Colors.Black)
    txtFirstName.TextColor = Colors.Black
    txtLastName.TextColor = Colors.Black
    txtUserName.TextColor = Colors.Black
    txtPin.TextColor = Colors.Black
    txtDOB1.TextColor = Colors.Black
    txtFeet.TextColor = Colors.Black
    txtInches.TextColor = Colors.Black
    txtFirstName.Background = cd2
    txtLastName.Background = cd2
    txtUserName.Background = cd2
    txtPin.Background = cd2
    txtDOB1.Background = cd2
    txtFeet.Background = cd2
    txtInches.Background = cd2

But why would this be the cause, take a look at the image below, you can see that the typing area is still the same original size as I can type past the right border, so it seems like only the border is the part that is shrinking, this is very strange, never seen anything like this before.
edittext_bug.png


Any thoughts, anyone?

Walter
 
Upvote 0

walterf25

Expert
Licensed User
You have to create a colorDrawable for each edittext especially if some vary in width
WOW, that easy, how did you find this out, i must have missed class that day :mad:

it works, thanks.
Walter
 
Upvote 0
Top