I calculate Top value (to addView) as 100%y - Height.
I noticed that 100%y provides different values, if I rotate device with opened or closed virtual keyboard.
I tried to apply workaround and force IME.HideKeyboard in Public Sub Activity_Pause(UserClosed As
Boolean) if UserClosed = False then IME.HideKeyboard, but it didn't help.
'To manage IME event: IME_HeightChanged
SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateHidden)
I use this attribute to manage positions of some views depended on keyboard is opened or closed.
There is no issue with different values of 100%y, if the windowSoftInputMode is not set.
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Log($"100%y <${100%y}>"$)
Dim edt As EditText
edt.Initialize("")
edt.InputType = Bit.Or(edt.InputType, 524288)
Activity.AddView(edt, 20dip, 50dip, 100dip, 40dip)
edt.Text = 100%y
End Sub