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
    photo_2018-06-20_20-54-36.jpg
    137.3 KB · Views: 311

Alexander Stolte

Expert
Licensed User
Longtime User
i have no problem with this code
This if the keyboard is show:
B4X:
dim newrootheight  as float
newrootheight = Page1.RootPanel.Height - Height
pnl_ground.Top = newrootheight - pnl_ground.Height
and this, if the keyboard is hide:
B4X:
pnl_ground.Top =  Page1.RootPanel.Height - pnl_ground.Height
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
i have no problem with this code
This if the keyboard is show:
B4X:
dim newrootheight  as float
newrootheight = Page1.RootPanel.Height - Height
pnl_ground.Top = newrootheight - pnl_ground.Height
and this, if the keyboard is hide:
B4X:
pnl_ground.Top =  Page1.RootPanel.Height - pnl_ground.Height
my solution is that.

My Situation was, i had a TextBox in the middle, left a "Take Photo" Button, right a Send Button, on the TextView was a white line, because on Android i dont found a solution to change the color of EditText Line, and a white line over the TextBox for Multiline, to seperate it with the content in the list above.
 
Upvote 0

Pooya1

Active Member
Licensed User
my solution is that.

My Situation was, i had a TextBox in the middle, left a "Take Photo" Button, right a Send Button, on the TextView was a white line, because on Android i dont found a solution to change the color of EditText Line, and a white line over the TextBox for Multiline, to seperate it with the content in the list above.
But your solution not working for when use Emoji
 
Upvote 0

Pooya1

Active Member
Licensed User
But which user has a keyboard where there are only emojis and no letters?
Normally, you open the keyboard and open then the Emojis keyboard.
You suppose i enter in Textfield and select English language,
Till here my Textfield top is correct
When i select emoji keyboard,my Textfield top is wrong
 
Upvote 0

Pooya1

Active Member
Licensed User
Which iPhone do you use?
On my IPhone 6S Plus and 5S, there the keyboard height is not change if i switch to emojis
6S
For English language,Height is 258 and for Emoji keyboard is 206
While for Emoji must return 258 and for English return 206
If the result was correct,my code was working perfectly
 
Upvote 0

Pooya1

Active Member
Licensed User
wich IOS? Because my Keyboard looks different to yours.
iOS 11

OS or Device is not important about keyboardheight
It is only incorrect height for me

B4X:
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

This code is working for me now but no for first time
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Please disable AutoSuggest and test it again,So you see Top of textfield is wrong
yes, but This is an important feature for users, I hate apps, where this is disabled because I've become lazy to write words completely, especially when you're on the go, you commit yourself constantly.
 
Upvote 0

Pooya1

Active Member
Licensed User
yes, but This is an important feature for users, I hate apps, where this is disabled because I've become lazy to write words completely, especially when you're on the go, you commit yourself constantly.
But i dont hate
My app haven't to have bug about Textfield's Top
In any status keyboard,Textfield have to place in Good position
 
Upvote 0
Top