iOS Question Problem in Keyboard Height

Pooya1

Active Member
Licensed User
My below code have no problem when i use simple keyboard(English or other language)
But when i select Emoji keyboard,my calculation about Keyboardheight is wrong
My code is
B4X:
Sub Page1_KeyboardStateChanged (Height As Float)
If Height > 0 Then
        pnlcomment.Top    = Page1.RootPanel.Height-pnlcomment.Height-Height
    Else
        pnlcomment.Top    = Views.GetRealPageSize(Page1).Bottom - pnlcomment.Height
    End If
End Sub
When i change language to emoji,this event return value but it is wrong
How do can i show textbox panel on top keyboard in all language or any size keyboard?
 

Attachments

  • photo_2018-06-20_20-54-36.jpg
    137.3 KB · Views: 347

Pooya1

Active Member
Licensed User
Then u should caluclate the top value new in the "Page Resize" Event, if the Keyboard is show, then you can place the Panel with the same Formel, but with the new values.
My problem is KeyboardHeight
It is wrong for first time and other time it is working
For first time,height for emoji is 216 and for English is 258 and for next time,height for emoji is 258 and for english is 216 and this values is correct not first time
If i can solve value for first time so i can show correct position for Textfield
 
Upvote 0

Pooya1

Active Member
Licensed User
you dont need the KeyboardHeight to calculating it right. The Page height begins over the keyboard, if you set the panel how in my code, then it fits.
Resize event raise once
When i enter into textfield,Resize event not raise and i cannot change panel's position
Please give me exact information
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
save the height value if the normal keybaord is open and the height if the keybaird is not open, then open the emojis, compare it with the 2 Values and if it is not fit, then you know that the emoji keyboard is open and then you can calculate the top value new.
 
Upvote 0

Pooya1

Active Member
Licensed User
I said you values is different and wrong
Please test yourself
I know your solution but when data is wrong
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
i use this, because the "Height" value have the current height value, then i calculate minus the size of the root panel. it can not be wrong, you just have to understand what the code does and what values are changed
B4X:
newrootheight = Page1.RootPanel.Height - Height
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
If Height = 216 Then
TextField1.Top = Page1.RootPanel.Height - TextField1.Height - 258
Else if Height = 258 Then
TextField1.Top = Page1.RootPanel.Height - TextField1.Height - 216
End If
and your code say it right! if height 216 then the emoji keyboard is open and if 258 it is close.
So you can not tell me that the values are wrong
 
Upvote 0

Pooya1

Active Member
Licensed User
and your code say it right! if height 216 then the emoji keyboard is open and if 258 it is close.
So you can not tell me that the values are wrong
Really values are wrong
216 is for Emoji keyboard and 258 is for English
While 258 is for emoji keyboard
So it is wrong
 
Upvote 0

Pooya1

Active Member
Licensed User
@Erel please watch attachment video from my phone
Your sample code have wrong in calculation also
When i switch to emoji keyboard,your sample have problem
 
Upvote 0

Pooya1

Active Member
Licensed User
Works fine here. Are you testing it on a real device?
Yes it is my iPhone 6S
Yes it is working fine but in Emoji keyboard if you care,you see your sample have problem in emoji keyboard and panel not resize
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…