I want to display a TextField at the bottom of the screen in QML for SailfishOS.
I attempted multiple tries but the TextField is always at the top of the screen.
import QtQuick 2.0
import Sailfish.Silica 1.0
ApplicationWindow {
id: screen
anchors.fill: parent
Item {
width: parent.width;
anchors.bottom: screen.bottom
TextField {
width: parent.width;
anchors.bottom: screen.bottom
id: input
placeholderText: "URL"
inputMethodHints: Qt.ImhNoPredictiveText
validator: RegExpValidator { regExp: /^[a-zA-Z]{3,}$/ }
}
}
}
Kaymaz, in common, your question is not related to SailfishOS. And you was almost right, but made several errors in your code. You can use this code:
I do not recommend use folibis's approach for several reasons:
anchors in QML -- use it.30).TextField's height change -- you got need to changey: screen.height - 30. So this kind of code becomes hard to maintain.