Open mattwilson345 opened 1 year ago
@emmauss didn't we have a solution for this with resizing the root view? I am pretty sure it worked at some point.
The root view isn't resized by default, but one can adjust the padding of the main view to account for safe area, which currently includes keyboard insets on android, using the InsetsManager. But the internal views, i.e. the textbox needs to be hosted by a ScrollViewer, and always kept in view. This isn't implemented yet.
This issue is still valid and reproducible. But at least now there is a way to handle keyboard appearance and adjust the app accordingly. From the Avalonia side, we need to add automatic adjustments and bring a focused element to view, when the keyboard appears. But this is likely to happen mid-11.1.x.
The above InputPane implementation doesn't appear to actually have been released?
It's been on master for awhile but looking at 11.0.9, nothing.
Considering how important this is on mobile, this is rather surprising...
@LyleRolleman-plst features go into major release, e.g. 11.1. If you need it now, use nightly builds until 11.1 drops.
Tried the nightly build but InputPane was always null on TopLevel :(
Will just roll my own I guess until this is sorted out
Tried the nightly build but InputPane was always null on TopLevel :(
It means that your target OS either doesn't support input pane API (like, older Windows), or Avalonia didn't yet implemented support for it (like, some Linux distros, I believe)
Tried the nightly build but InputPane was always null on TopLevel :(
It means that your target OS either doesn't support input pane API (like, older Windows), or Avalonia didn't yet implemented support for it (like, some Linux distros, I believe)
It was Android actually (emulator to be precise)
Same thing also appeared to be the case on iOS (physical), though I'm having some debugger woes there atm so not 100% sure (it hits breakpoints but doesn't show anything, treats it as external code)
One possibility I can think of is it's just not initialized yet, as I was trying to do it in my MainView constructor. Will have to see.
One possibility I can think of is it's just not initialized yet, as I was trying to do it in my MainView constructor. Will have to see.
Try to use Dispather.UiThread.Post
with priority Loaded
when you want to access view elements from constructor.
One possibility I can think of is it's just not initialized yet, as I was trying to do it in my MainView constructor. Will have to see.
Try to use
Dispather.UiThread.Post
with priorityLoaded
when you want to access view elements from constructor.
That's good to know.
I was able to resolve the issue by moving the access into the Loaded event as well
Describe the bug
On phones the on-screen keyboard can cover up textboxes and you cannot see what you are typing. It is easy to add bottom margin to the scroll-viewer, BringIntoView; in GotFocus. If there was a way of knowing how tall the On-screen-keyboard was it would be perfect, but I cannot find a solution for this problem.
To Reproduce
have a textbox in the bottom 20% of the screen.
Expected behavior
The textbox on top of on-screen keyboard. Or if you knew the height of the on-screen keyboard you could do this yourself.
Screenshots
Environment
IOS and Android. Avalonia-Version: [11.0.4]
Additional context