Procedure:
1) Create a class that extends Popup .
2) In this class use your own manager
a) take one vertical field manager
b) add some text using label field and also a button inside this vertica field manager
c) And add vertical field manager in your screen
PopupScreen popup = new PopupScreen(new VerticalFieldManager());
popup.add(new LabelField("Hello!"));
popup.add(new ButtonField("OK"));
Create Border less Popup screen
PopupScreen popup = new PopupScreen(new VerticalFieldManager());
popup.add(new LabelField("Hello!"));
Border border = BorderFactory.createSimpleBorder(new XYEdges(), Border.STYLE_TRANSPARENT);
popup.setBorder(border);
Push popup screen:
UiApplication.getUiApplication().pushScreen(new MyPopup());
Closing a popup scren when uer clicks on Escape Key:
Need to implement Keychar method
popupscreen1=new PopupScreen(myverticalfieldmanager)
{
protected boolean keyChar(char c, int status, int time)
{
if (c == Characters.ESCAPE)
close();
return super.keyChar(c, status, time);
}
};
Have a look at this:
Thanks for the borderless popup! It was what I was looking for! Thanks man!
ReplyDeleteyour welcome :)
ReplyDeletewhere is mypopup() initialized?
ReplyDeleteweb hosting murah
ReplyDelete