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
martin78
Posts: 27
Registered: ‎05-15-2012
My Device: Dev Alpha B
My Carrier: Bell

Nested ListView Awesomesauce

Gentlemen,

 

Say I have a main top-level ListView A, which contains many things, one of which is another listview B.

 

Question 1:

- How can I force the size of listview B to be the size required so that you only need to scroll listview A to see all the contents (in other words, the size of listview B is dynamic, as a function of the number of items contained). I don't want to put all in listview A due to look and feel and retaining visual containment of data into groups.

 

Question 2:

- Disabling scrolling on a listview...any simple option apart from adding a transparent container on top of it? tell me there's another way haha :smileytongue:

 

Thanks!

 

Martin

 

------------------------------------------
Macadamian Technologies Inc.
http://www.macadamian.com/
Please use plain text.
Developer
simon_hain
Posts: 16,111
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Nested ListView Awesomesauce

as far as i tried my attempts with setting sizes for ListView have failed.

I would suggest that you check https://developer.blackberry.com/cascades/reference/bb__cascades__groupdatamodel.html for your list, maybe you can put everything in one ListView after all.

I opted for putting everything into my ListView, even a TextField and a Button, as it did not layout nicely otherwise.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Dredvard
Posts: 160
Registered: ‎01-27-2012
My Device: Playbook
My Carrier: Rogers

Re: Nested ListView Awesomesauce

spaceQuota is the only method I've found to allow you to set your listview sizes.

 

https://developer.blackberry.com/cascades/reference/bb__cascades__stacklayoutproperties.html#spacequ...


 You might have to use negative numbers or manually calculate things.  I've used a LayoutHandler to know dynamically how big things are on the screen.

 

If I want an area to disappear in an animated manner just set the space quota to .001.

 

---
If you find my post helpful please "like" it and "accept as a solution"
Please use plain text.