01-21-2013 06:53 AM
HI All,
I am setting background of a page. It shows good on Qml Preview. But when i run the app on simulator.
There is a thin padding of white color appears on left and top.
Please tell me whats the issue.
I've attached the screenshot. of the Qml code, Qml Preview and the Simulator Preview.
Regards
Ekamsh
02-12-2013 04:06 AM
HI Guys,
Please help me.
02-12-2013 05:10 AM
Can you post your code as text, please?
02-12-2013 05:14 AM
// Default empty project template
import bb.cascades 1.0
import bb.system 1.0
// creates one page with a label
NavigationPane {
id: navPane
backButtonsVisible: false
Page {
// property alias labelText: errorTextid.text
Container {
background: Color.create("#003366")
layout: StackLayout {
}
verticalAlignment: VerticalAlignment.Fill
horizontalAlignment: HorizontalAlignment.Fill
ImageView {
imageSource: "asset:///images/kayakoLogo.png"
horizontalAlignment: HorizontalAlignment.Center
bottomMargin: 100
}
Label {
id: errorTextid
objectName: "errorObject"
text: ""
horizontalAlignment: HorizontalAlignment.Center
textStyle.color: Color.Red
}
TextField {
id: helpdeskurlTextBox
horizontalAlignment: HorizontalAlignment.Center
hintText: "Helpdesk Url"
leftMargin: 65.0
topMargin: 50.0
preferredWidth: 0.0
minWidth: 500.0
onTouch: {
errorTextid.text = "";
}
verticalAlignment: VerticalAlignment.Top
textStyle.textAlign: TextAlign.Center
textStyle.color: Color.DarkGray
}
TextField {
id: usernameTextBox
horizontalAlignment: HorizontalAlignment.Center
hintText: "Username"
leftMargin: 65.0
topMargin: 20.0
preferredWidth: 0.0
minWidth: 500.0
onTouch: {
errorTextid.text = "";
}
textStyle.textAlign: TextAlign.Center
textStyle.color: Color.DarkGray
}
TextField {
id: passwordTextBox
horizontalAlignment: HorizontalAlignment.Center
hintText: "Password"
leftMargin: 65.0
topMargin: 20.0
bottomMargin: 150
preferredWidth: 0.0
minWidth: 500.0
inputMode: TextFieldInputMode.Password
onTouch: {
errorTextid.text = "";
}
textStyle.textAlign: TextAlign.Center
textStyle.color: Color.DarkGray
}
Button {
id: loginButton
text: "Login"
horizontalAlignment: HorizontalAlignment.Center
attachedObjects: [
ComponentDefinition {
id: goToWebView
source: "screenHome.qml"
},
LoadingPopUp {
id: loading
onClosed: {
loginButton.setEnabled(true);
if (errorTextid.text.trim() == "") {
var blogpage = goToWebView.createObject();
navPane.pop();
navPane.push(blogpage);
}
// var Page1 = getSecondPage();
// loginNavPane.pop()
// loginNavPane.push(Page1)
}
}
]
onClicked: {
if (helpdeskurlTextBox.text == "") {
errorTextid.text = "Please enter helpdesk url";
} else if (usernameTextBox.text == "") {
errorTextid.text = "Please enter username";
} else if (passwordTextBox.text == "") {
errorTextid.text = "Please enter password";
} else {
/*loginButton.setEnabled(false);
* app.initiateRequest(helpdeskurlTextBox.text, usernameTextBox.text, passwordTextBox.text)*/
app.HandleBtnLoginClick(helpdeskurlTextBox.text, usernameTextBox.text, passwordTextBox.text);
loading.open();
}
}
}
ActivityIndicator {
id: loginIndicator
objectName: "indicator"
preferredWidth: 130
preferredHeight: 130
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
onStopped: {
loginButton.setEnabled(true);
if (errorTextid.text.trim() == "") {
var blogpage = goToWebView.createObject();
navPane.push(blogpage);
}
}
}
}
}
}Its my QML code.
02-12-2013 05:25 AM
Since you set both vertical alignment and horizontal alignment of the Container to fill it should work. We do the same and it works. Maybe, it's just a bug in the simulator and it works on the device.
The only difference I see is that you set NavigationPane.backButtonsVisible to false.
You can also try to nest two Container. But this is only speculation. Your code should work.