04-25-2011 12:46 PM
Hello, I'm looking to center a button on the middle of the screen. From what I've seen I should be able to do this by adding the HorizontalFieldManager into the VerticalFieldManager:
HorizontalFieldManager mensButton =
VerticalFieldManager mensButton2 =
= new ButtonField("Mens Sports");
For some reason this only centers the button horizontally, and not vertically. I've tried tried inculdign USE_ALL_HEIGHT, but still doesn't work. Any ideas?
Solved! Go to Solution.
04-25-2011 01:11 PM
1) You indeed need your HFM to have USE_ALL_HEIGHT.
2) Since your Screen most probably has a VerticalFeildManager as a delegate (or a main manager, in case of MainScreen), add mensButton2 to mensButton and mensButton to the Screen, not the other way around.
3) If you use MainScreen, make sure it has NO_VERTICAL_SCROLL style bit!
Anyway, this question has been asked so many times it's not even funny. Unfortunately, it's not easy to use "Search" feature for this - "center screen" or "middle screen" or other stuff brings way too many articles, most of which are irrelevant.
I've recently gave some detailed explanation about this, though - look at this post: