Android Question [solved] IME_HeightChanged and buttons

robotop

Member
Licensed User
Longtime User
Hi all, I'm testing a small program. There is something strange. This is the sub that have problems:
B4X:
Sub IME_HeightChanged(NewHeight As Int, OldHeight As Int)
    If NewHeight < OldHeight Then ' if keyboard appeared
'        btnHide.Visible = True
        ToastMessageShow("show", False)
        btnHide.SetLayoutAnimated(500, 0, btnHide.Top, btnHide.Width,btnHide.Height) ' left to right: show
    Else ' keyboard disappeared
'        btnHide.Visible = False
        ToastMessageShow("hide", False)
        btnHide.SetLayoutAnimated(500, 0-btnHide.Width, btnHide.Top, btnHide.Width,btnHide.Height) ' right to left: hide
    End If  
End Sub
It seems that I can't set the attribute visible=false to the button (it doesn't work). Just for testing, I tried to make the button disappear simply "shifting" it out of the screen, and it worked.
Is there any reason for this strange behavior ?
Thanks.
 

robotop

Member
Licensed User
Longtime User
Hi JordiCP, thanks for your prompt answer.
I tried, but it doesn't work.
Usually the visible property is applied without the need to invalidate the view, but anyway I tried, just to see what happens.
Nothing... but, thank you.
 
Upvote 0

robotop

Member
Licensed User
Longtime User
I can't explain why, but now the sub works... with or without the btnHide.invalidate o_O
May be it's time to take a rest, for me. It's Sunday!
 
Upvote 0
Top