Virtual keyboard is covering my TextField when typing text
-
I'm using Symbian TextField component for entering text. When clicking on it, I get phone's virtual keyboard displayed and hiding my TextField underneath.
I've checked the SplitView example, but couldn't figure out how to apply it to the TextField component.
-
One more thing. I have two TextField:s one after another (registration page). How InputContext suppose to help me in this situation?
-
@streakaoid: First things first: Are you using Qt 4.7.4 and Qt Quick 1.1? Are you on Symbian? Do you see a split-keyboard?
Assuming the above, the goal here (as I understand) is to ensure that the current textField (that the user is currently typing into) is fully visible. InputContext tells you the area that the virtual keyboard covers at the moment, so that you can reposition your textfield so that it doesn't overlap with the virtual keyboard.
I'm assuming that in your case, you have a screenful of stuff, with one or more textFields in the bottom half of the screen. When the keyboard comes up, it covers the bottom part of the screen, so only the stuff at the top is visible. The textField at the bottom becomes invisible.
Effectively, when the keyboard is up, the available visible area is reduced. You could now try to squeeze whatever you want visible in the reduced visible area (by reducing the height of the item by inputContext.height). If you cannot accommodate all of that in the reduced area, you can wrap all of it in a Flickable element.
-
Just saw that if you set 'platformSoftwareInputPanelEnabled: true' in your PageStackWindow, the "reducing the height of the item by inputContext.height" part, that I mentioned earlier, is automatically handled. Maybe you can just try turning that property on to check if that suffices in your case.
-
@roopeshchander: Yes, I'm on Qt 4.7.4 and Qt Quick 1.1, creating an application for Symbian Anna. To be even more clear, the virtual keyboard is visible only when I run the app on Nokia N8 device, and not visible in simulator.
Did some learning yesterday. Seems that inputContext is returning visible? and height properties depending on if the virtual keyboard visible. This helps, in a way that I can create states and reposition the content on the screen after vkb becomes visible.
What do you call "split keyboard"?
-
Is split-keyboard suppose to look something like this?: http://www.developer.nokia.com/Community/Wiki/File:Split_screen_portrait.png
Then no, I don't see that. I'd like to.
-
Found this topic on StackOverflow:
http://stackoverflow.com/questions/7410695/split-screen-keyboard-in-qt-4-7-4But didn't worked for me.
-
[quote author="strekazoid" date="1321429420"]Is split-keyboard suppose to look something like this?: http://www.developer.nokia.com/Community/Wiki/File:Split_screen_portrait.png
Then no, I don't see that. I'd like to.[/quote]
That was before Anna. Anna and beyond, we get a QWERTY keyboard in portrait mode too. Like this: "Belle-split-view-qml-app.png":http://labs.qt.nokia.com/wp-content/uploads/2011/11/Belle-split-view-qml-app.png
To enable split-view keyboard:
- If you don't use Symbian Qt Quick Components 1.1, set Qt::AA_S60DisablePartialScreenInputMode to false [1]
- If you use Symbian Qt Quick Components 1.1, do nothing (should already work) [1]
If you don't get a splti-view keyboard even after doing the above, what are you seeing? Can you post a picture?
[1] http://labs.qt.nokia.com/2011/11/08/qt-4-7-4-release-bundle-for-symbian-news/
-
I've tried adding following line to main.cpp with both true and false values. Doesn't affect the behaviour of UI in any way.
@QCoreApplication::setAttribute(Qt::AA_S60DisablePartialScreenInputMode, false);@Here is a screen without vkb, two textfields:
!http://www.stereofinland.com/images/sc001.jpg(screenshot)!Here is a screenshot when second textfield is focused. It is hidden now under the vkb:
!http://www.stereofinland.com/images/sc003.jpg(screenshot)! -
Reading the release notes about split view gives me impression that this behavior is normal and is in fact a feature. So, the only way is now for me to create additional states, one state per textfield, and adjust the view according to the vkb state?
-
[quote author="strekazoid" date="1321433304"]I've tried adding following line to main.cpp with both true and false values. Doesn't affect the behaviour of UI in any way.
@QCoreApplication::setAttribute(Qt::AA_S60DisablePartialScreenInputMode, false);@
[/quote]The behaviour doesn't change probably because you're already using Qt Quick Components 1.1.
[quote author="strekazoid" date="1321433543"]So, the only way is now for me to create additional states, one state per textfield, and adjust the view according to the vkb state?[/quote]
Did you try my earlier suggestion about setting 'platformSoftwareInputPanelEnabled: true'? That should suffice if all you have is two textfields and if they're anchored to the page (not positioned absolutely).
-
Re-reading your last post gives me the impression that you prefer the earlier interface (non-split-view keyboard), where the text entry is made in a separate view altogether (something like "this":http://qtsource.files.wordpress.com/2011/05/normal_vkb.png, but with a QWERTY layout).
If indeed that's what you want, you can just switch back to Qt Quick Components 1.0, and this split-view keyboard feature will disappear altogether. Maybe that is what you're looking for?
-
Hi guys,
I have absolute same issue (Symbian Belle) - building a registration page and the fields located in lower part of the screen start to be blocked by Input Panel (VKB).
I went through the example provided...
- I use PageStackWindow and setting ‘platformSoftwareInputPanelEnabled: true’ doesn't change anything. Maybe there is something else we should do to make it work (like setting content property?)
- Then I tried to implement a state behavior onActiveFocusChanged. Issue is on the device the inputContext.visible param always returns false regardless of actual position. Maybe it is a bug or maybe not...
Anyway what would be good from documentation standpoint is to provide exact examples of how PageStackWindow should be used to accomodate the feature and adjust content margins etc to make it visible...
Funny thing is that I tried splitscreen keyboard some time ago via a workaround (read some post re this). And at that time the view WAS adjusted just like it needs to be...
-
Before I posted about setting platformSoftwareInputPanelEnabled to true, I had verified that it works in a small example. This is the QML code I used (most of it is auto-generated by Qt Creator):
main.qml:
@import QtQuick 1.1
import com.nokia.symbian 1.1PageStackWindow {
id: window
initialPage: MainPage {tools: toolBarLayout}
showStatusBar: true
showToolBar: true
platformSoftwareInputPanelEnabled: trueToolBarLayout { id: toolBarLayout ToolButton { flat: true iconSource: "toolbar-back" onClicked: window.pageStack.depth <= 1 ? Qt.quit() : window.pageStack.pop() } }
}@
MainPage.qml:
@import QtQuick 1.1
import com.nokia.symbian 1.1Page {
id: mainPage
Item {
anchors.fill: parent
TextField {
anchors { top: parent.top; topMargin: 20; horizontalCenter: parent.horizontalCenter; }
width: 200
text: "Up above"
font.pixelSize: 20
}
TextField {
anchors { bottom: parent.bottom; bottomMargin: 20; horizontalCenter: parent.horizontalCenter; }
width: 200
text: "Down under"
font.pixelSize: 20
}
}Rectangle { anchors { fill: parent; margins: 5; } color: "transparent" border.color: "blue" }
}@
Both text fields are always visible, irrespective of whether the virtual keyboard is shown or not. I checked this on an X7-00 running Symbian Anna with Qt 4.7.4 installed.
-
The example by roopeshchander works fine for me too.
I've actually solved this problem this way:
@State {
name: "firstName"; when: inputContext.visible && nameTextfield.focusPropertyChanges { target: backgroundImage y: -20 } },@
backgroundImage in my case is the root element for the whole page, so changing the y property will move it up. The y value actually have to be attached to the inputContext.height value, and not hardcoded.
-
Well, it is automated. As is evident in QML code I posted earlier, it is all handled by the components as long as the items are anchored properly (i.e. anchored so that the items stay within the bounds of the page even if the page resizes).
-
I'm facing the same problem, all the items are anchored correctly. I've placed few textfields inside a flickable which resizes when VKB is visible but still it covers bottom textfields
I tried workaround suggest by strekazoid but even that's not working or may by I'm not doing it the correct way.
It would be great if some could help me.
thanks.
-
ravirdv, to solve this issue, use this: http://tftfy.blogspot.com/2012/02/help-virtual-keyboard-hiding-input-on.html
It works the same way as in Meego. With the bottom TextFields lifting up.