01-04-2010, 09:47 AM
|
#1 (permalink)
|
| Knows Where the Search Button Is
Join Date: Oct 2009 Model: 8130 PIN: N/A Carrier: don't know
Posts: 15
Post Thanks: 0 Thanked 0 Times in 0 Posts
| Button is not working on Storm Please Login to Remove! Hi,
I have placed two buttons in the VertcalFieldManager and to display both the buttons vertically center, i have used setPositionChild().
Now my problem is only first button is taking events but not the second one.
Below is my code snippet for VerticalFieldManager in which i added two ButtonFields.
VerticalFieldManager formScreenLayout = new VerticalFieldManager(
Manager.USE_ALL_WIDTH) {
protected void sublayout(int maxWidth, int maxHeight) {
MainScreen currentScreen = (MainScreen) UiApplication
.getUiApplication().getActiveScreen();
int height = currentScreen.getHeight();
for (int index = 0; index < currentScreen.getDelegate()
.getFieldCount(); index++) {
if (index != currentScreen.getDelegate()
.getFieldWithFocusIndex())
height -= currentScreen.getDelegate().getField(index)
.getHeight();
else
break;
}
super.sublayout(maxWidth, height);
setExtent(getWidth(), height);
int heightOfFields = getField(0).getHeight()
+ getField(1).getHeight() ;
setPositionChild(getField(0), getField(0).getExtent().x,
(height - heightOfFields) / 2);
setPositionChild(getField(1), getField(1).getExtent().x,
(height - heightOfFields)/2 + getField(0).getHeight());
}
};
Does any one have an idea why second button is not working on Storm???? |
| Offline
| |