Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 92
Registered: ‎08-01-2013
My Device: Z10, Q5, Q10
My Carrier: Vodaphone
Accepted Solution

Height of custom picker.

Hi all,

 

I wanted my drop down to have multiple lines in one option.

But that is not possible, so i implemented custom picker and put 2 label in the same,

so that i can split my text string and show it on them, but again the height of custom picker does not expand.

 

Is there any way to increase the height of one row of the custom picker?

Please help.

 

Attached is the screenshot of my output.

 

here is what i do in createItem()

 

VisualNode* PickerItemProvider::createItem(Picker* pickerList, int columnIndex)

{
     Container * returnItem = Container::create().background(Color::Yellow) ;

     returnItem->setPreferredHeight(200) ;

 

     Label * lineOne = Label::create().objectName("desc");
     lineOne->setMultiline(true) ;
     returnItem->add(lineOne);

 

     Label * lineTwo = Label::create().objectName("asc");
     lineTwo->setMultiline(true) ;
     returnItem->add(lineTwo);

 

     return returnItem;
}

 

Tried adjusting using preffered height/width and layouts.

 

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Height of custom picker.

Not that I know of, you will need to implement your own.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 92
Registered: ‎08-01-2013
My Device: Z10, Q5, Q10
My Carrier: Vodaphone

Re: Height of custom picker.

How m i to go about that?

Drop downs didnt do the trick for me, thats why to customize  my view (have 2 labels in one row) i went for custom pickers.

What next, f this is also failing to do the job??

Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: Height of custom picker.

Check the below link.

 

https://www.dropbox.com/s/y8mplfiw6741chd/assets.zip

 

Create a sample project.

replace the downloaded unzipped assets folder with the sample one...

Test it and do customization accordingly

Developer
Posts: 92
Registered: ‎08-01-2013
My Device: Z10, Q5, Q10
My Carrier: Vodaphone

Re: Height of custom picker.

This does work. 

The bottomline being DropDown and CustomPicker (with bb::cascades:Smiley TongueickerProvider) cannot be used for multiline Options, and we will have to implement multiline picker using a list view, image views etc., from scratch as suggested by the post above.