I have a Dialog containing a header, footer, and content item which is a ListView:
Dialog {
width: 200
height: 200
x: 10
y: 100
header: Rectangle {
}
contentItem: ListView {
delegate: TextField {
// this is covered by the Android keyboard
}
}
footer: Rectangle {
}
}
On iOS the whole screen is shifted up so that the ListView's TextField (https://doc.qt.io/qt-5/qml-qtquick-controls2-textfield.html) owning the text cursor is always visible. On Android the TextField's cursor is covered by the Android keyboard. I already tried to set android:windowSoftInputMode="adjustResize" in the AndroidManifest.xml but without success.
Is there an easy way to make sure that the TextField currently owning the cursor is always visible? Or is the only solution to manually move the Dialog's y coordinate?
Qml with hidden keyboard:
Qml keyboard hidding cursor:
Regular Android text field:
Regular Android text field is shifted up when the keyboard is open:
Regards,
The entire text view? No, that's not how keyboards work in Android. The only lever you have is the softInputMode, which is either pan or resize. In pan mode, the screen is scrolled up such that the cursor is always visible (but the rest of the text view may not be). In resize mode, the app is resized in the space above the keyboard, and then if needed shifted so the cursor is visible. This can sometimes make more of the screen visible, if you had empty space on screen and your layout is set to scale well (login screens frequently benefit). But there is no way to ensure the entire text view, or any other field, is still on screen. It's just not how Android works.
Related
I have screen with search view at the top and RecyclerView (parent is ScrollView). When search result is empty I'm showing TextView with text "Nothing found". The problem is that the text is covered by the keyboard. I'm using ADJUST_RESIZE and when the keyboard rises the content is resized so that the text is visible on the screen and not hidden behind the keyboard.
But I have a slightly different case, when the keyboard is already visible, but there is no TextView, but then at the end of the search, if nothing is found, I show the TextView.
And in this case, the screen is no longer resized. Is it possible to initiate a screen resize in such a way that the TextView rises above the keyboard and becomes visible? And will such an operation be resource-intensive?
Please, help me.
When I use a textfield on the page I designed with expanded, everything gets shrink when the keyboard is opened. How can i disable this.
If you would like not to scroll the page, set Scaffold's resizeToAvoidBottomInset property to false. It will avoid any effect that pops up from the keyboard. But it comes with a caveat If your TextField is placed within the height of keyboard, whatever user types will not be able to see. Try this if it works for you.
you can use singlechildscrollview or listview widget. They will make it scroll.
and you can use MediaQuery.of(context).viewInsets.bottom for padding or margin. Get keyboard height in Flutter.
Unable to scroll screen while keyboard is opened.I design a screen with labels, button and textarea. Textarea will be hidden for the first time, when user clicks a button, we are showing text area to the user.Now the issue is when i focus on textarea scrolling doesn't work and textarea is being covered by keyboard.
What we observed is the problem with hide and show of textarea. If i put textarea static everything works as expected.
For some other reasons, I had this line in my code
cordova.plugins.Keyboard.disableScroll(true);
These are the things I've tried and couldn't make it work
$ionicScrollDelegate.$getByHandle('mainScroll').scrollTop();
$ionicScrollDelegate.ScrollBottom();
$ionicScrollDelegate.scrollTo();
$ionicScrollDelegate.scrollBy();
- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated;
Give the x and y direction for your textview. When dismissing keyboard use it again and make co-ordinates (0,0). This may help you.
i am playing with android soft keyboard example.but the problem i m getting predictive text area overlap the edit text box. I tried both
android:windowSoftInputMode="stateVisible|adjustResize"
and
android:windowSoftInputMode="stateVisible|adjustpan" but nothing
That's a problem with the keyboard. The keyboard implements a function onComputeInsets, which provides a visible inset and a content inset. If they make the visible inset bigger than the content inset, the difference will always overlap the app. There's no way for the app to fix this. You can see that if you switch to a different keyboard that likely won't happen.
I have developed an iPhone app and now going to port it to Android. Almost all features work but the only thing I noticed is when I focus any Texbox or Textarea, the keyboard is opened and moves the whole page off the screen. I got to know that putting android:windowSoftInputMode="adjustPan" would solve the issue but then another issue came out.
Now when I focus any text element, the keyboard is opened but the view size is squeezed to the height (minus keyboard height) shifting bottom tab buttons above keyboard which is very bad effect in my opinion. Although it doesn't now move the whole page off the screen but can I use this property android:windowSoftInputMode="..." to ask it to show keyboard over tab buttons (hiding tab buttons under keyboard) but just move the view if the text elements are being hidden?