0
Mobile devices move the elements up when the keyboard is called, but there are elements that stay in the same position when the device keyboard is called as in the images below.
How can I keep a Qml item fixed in position when the device keyboard is called?
I need the Rectangle
with id: principal
stay fixed in position
import QtQuick 2.4
import QtQuick.Window 2.2
import QtQuick.Controls 1.3
Window {
visible: true
property int larguraTela: 360
property int alturaTela: 640
width: larguraTela
height: alturaTela
maximumWidth: larguraTela
maximumHeight: alturaTela
minimumWidth: larguraTela
minimumHeight: alturaTela
title: "OverStatusBar"
Rectangle {
id: principal
width: parent.width
height: parent.height * 0.15
anchors.top: parent.top
color: "orange"
}
Rectangle {
width: parent.width
height: parent.height * 0.85
anchors.top: principal.bottom
clip: true
Rectangle{
id: retangulo1
width: parent.width
height: parent.height * 0.5
anchors.top: parent.top
color: "grey"
}
Rectangle {
id: retangulo2
width: parent.width
height: parent.height * 0.5
anchors.top: retangulo1.bottom
color: "lightgrey"
TextField {
id: campoTexto
width: parent.width * 0.7
height: parent.height * 0.20
anchors.centerIn: parent
inputMethodHints: Qt.ImhDigitsOnly
}
}
}
}
You could send the Xcode print?
– PauloHDSousa
I’m not using Xcode, I’m using Qml.
– GuiDupas
I edited the post to enter the source code.
– GuiDupas
Hasn’t shown up yet.
– PauloHDSousa
I was looking for a solution to the problem and reading some websites saw that what I’m looking for is a Qml Type that works like the iOS navigation bar. There is some element in Qml that does this. I tried Stackview, but it keeps moving up when the keyboard appears.
– GuiDupas