BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 04-09-2008, 07:58 AM   #1
bbCincinnati
Thumbs Must Hurt
 
Join Date: Apr 2007
Location: Cincinnati, OH
Model: 8700c
PIN: N/A
Carrier: Cingular
Posts: 87
Default EditField

Please Login to Remove!

net.rim.device.api.ui.component.EditField

Hi Folks,

I'd like to have my cake and eat it too. I like the way the EditField automatically resizes itself as the text you enter grows bigger than the field. I also like how the getPreferredHeight() method allows you to set the height of the field to whatever you want. However, is there a way to kind-of combine these two features? What I want to do is to set the height of one of my text fields to double the normal height. However, when I enter more text than what will fit in those two lines, I'd like the EditField to automatically grow like it normally does. I was hoping that there would be a method like getMinimumHeight() or something like that, but I don't see one.

Or, might there be a way to make such an edit field (one where I've set the height) automatically "scroll" as you type in characters? Right now, it shows the first two lines I've typed, and nothing after that. It still allows me to enter more text, but doesn't show it.

Thanks in advance, if anyone can give me a pointer
Offline  
Old 04-09-2008, 10:27 AM   #2
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Default

you could use Font.getAdvance to get the length of a line and change the height of the field accordingly
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 04-10-2008, 11:59 AM   #3
louE
New Member
 
Join Date: Apr 2008
Model: 8703e
PIN: N/A
Carrier: vfw
Posts: 3
Default

I had a similar problem except that I also wanted to make the Field grow vertically instead of horizontally. What I did was wrap the EditField in an altered VerticalManager. You can make the EditField style USE_ALL_HEIGHT and override the VerticalManager's sublayout method. In the sublayout you call the super method, then check the extent of the Manager and change the extent height to a minimum height if it is smaller than you prefer. It is a roundabout fix, but it worked for me.
Offline  
Old 04-10-2008, 12:51 PM   #4
bbCincinnati
Thumbs Must Hurt
 
Join Date: Apr 2007
Location: Cincinnati, OH
Model: 8700c
PIN: N/A
Carrier: Cingular
Posts: 87
Default

Thanks to both of you for your responses!
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


OEM Dell XPS 8910 8920 8930 Alienware Aurora R5 R6 R7 Front Cooling Fan 7M0F5 picture

OEM Dell XPS 8910 8920 8930 Alienware Aurora R5 R6 R7 Front Cooling Fan 7M0F5

$13.81



Dell OEM Latitude Rugged Extreme 5414 Driving Board Cable for Cable 5414VERTCBL picture

Dell OEM Latitude Rugged Extreme 5414 Driving Board Cable for Cable 5414VERTCBL

$8.95



Dell OEM Latitude Rugged Extreme 7404 Docking Connector Circuit Board picture

Dell OEM Latitude Rugged Extreme 7404 Docking Connector Circuit Board

$14.95



Dell OEM Latitude Rugged Extreme 7404 GPS Antenna Junction Cable Cable KMX0M picture

Dell OEM Latitude Rugged Extreme 7404 GPS Antenna Junction Cable Cable KMX0M

$2.95



NEW DELL OEM REPLACEMENT PROJECTOR LAMP FOR 4220 4320 GENUINE ORIGINAL  picture

NEW DELL OEM REPLACEMENT PROJECTOR LAMP FOR 4220 4320 GENUINE ORIGINAL

$198.22



DELL 330-6581 3306581 725-10229 OEM LAMP FOR 1510X 1610HD 1610X  - Made By DELL picture

DELL 330-6581 3306581 725-10229 OEM LAMP FOR 1510X 1610HD 1610X - Made By DELL

$39.98







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