![]() |
Button is not working on Storm 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???? |
You need to override the touchevent mehtod following link may help you. http://www.blackberryforums.com/deve...st-fields.html |
Thanks. I did the same. But i didn't expect that on changing the position of a field, touchEvent() would be overridden. |
| All times are GMT -5. The time now is 05:55 AM. |
Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.