BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-02-2008, 09:57 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2008
Model: 8800
PIN: N/A
Carrier: Orange
Posts: 26
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default how do i center my fields verticly

Please Login to Remove!

Hey everyone.
I'm trying to set my VerticalFieldManager to center my fields in it verticly, so that it will space up my fields.

i tried creating the manager this way
VerticalFieldManager(VerticalFieldManager.FIELD_V CENTER
| VerticalFieldManager.USE_ALL_HEIGHT);

but still, all my fields go one after the other on the top and i get a lot of empty space in the bottom.

what is the recommended way to space up the fields? (or how to i center the fields vertically)

Also, whats the difference from VCENTER and FIELD_VCENTER?

thanks in advance.
Omri.
Offline  
Old 07-02-2008, 10:50 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

create your own manager
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 07-02-2008, 03:52 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2008
Model: 8800
PIN: N/A
Carrier: Orange
Posts: 26
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

The default Vertical Screen manager cant center fields vertically?
Offline  
Old 07-02-2008, 04:18 PM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Apr 2006
Location: Boston
Model: 8900
Carrier: AT&T
Posts: 98
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Centering Fields

Hi!

So, are you looking to do something like this (A):

.........Field 1.........
.........Field 2.........
.........Field 3.........

Or something like this (B):

..................................
..................................
..................................
..Field 1..Field 2..Field 3..
..................................
..................................
..................................

(A) centers fields horizontally (all fields are aligned with the horizontal center of the screen)
(B) centers fields vertically (all fields are aligned with the vertical center of the screen)

Using just a VerticalFieldManager all by itself will do neither of these - a VFM only lays out each field it contains vertically, one row at a time, left-justified.

To do (A), you need two things: a VFM (to layout each field on its own separate line), and a Style value (Field.FIELD_HCENTER) set on each field through the field's constructor.

To do (B), you may be able to get away with using a HorizontalFieldManager (to layout each field in one row, left to right), and a Style value (Field.FIELD_VCENTER) set on each field through the field's constructor. However, not actually having done this myself, I'm not sure whether that will actually give you (B) - it may vertically center the fields in the first "row", which will be the top of the screen. You may be able to combat this by setting the style value of the HFM to Field.FIELD_VCENTER.

If you're really aggressive and/or curious and/or bored, you can create your own brand of Manager, and do it brute-force.

Experiment! That's what coding is all about, really. And that's why God invented BlackBerry simulators.....

Cheers,

karl
__________________
Karl G. Kowalski
---------------
Owns a RAZR
Develops for BlackBerry
So next phone will be........an iPhone 3G!
Offline  
Old 07-03-2008, 10:35 AM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2008
Model: 8800
PIN: N/A
Carrier: Orange
Posts: 26
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

actually what i want is something else.
say i have 5 lines of space on the device, but i only put 3 fields.
so i want something like

field.....
..........
field.....
..........
field.....

Is that possible with the vertical manager? or do i need to create my own custom manager?
Offline  
Old 07-03-2008, 11:39 AM   #6 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

you can use a spacerfield or create your own manager.
__________________
java developer, Devinto, hamburg/germany
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.