12-09-2010 04:04 AM
i have a screen with a label field, on the click of the label field i push a popup screen
now this popup screen appears at the center of the screen, however i want to change the position of the popup screen
Please help..
my popup screen is as below
class PopUpScreen extends PopupScreen {
public PopUpScreen)
{
super(new HorizontalFieldManager() {
public int getPreferredWidth() {
return Display.getWidth() / 3;
}
public int getPreferredHeight() {
return Display.getHeight();
}
});
add(new LabelField("Select SMS Provider"));
add(addSpinBox());
UiApplication.getUiApplication().pushScreen(this);
}
12-09-2010 04:30 AM - edited 12-09-2010 09:19 AM
add this method..
protected void sublayout(int width, int height) {super.sublayout(width, height);setPosition(x, y);}
and set x & y co ordinates.
Edit: arkadyz is right there is no need of setExtent.
12-09-2010 09:16 AM
You don't need to setExtent in sublayout override - super.sublayout does that for you.
If you ever need to change the screen's position on some event - change your x and y and invoke updateLayout().