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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
rock_win
Posts: 134
Registered: ‎02-01-2009

Segmented Control setting proper alignment, padding and background color

I'm adding a Segmented Control with 3 options.

 

on top of the Segment Control there is other container with few other widgets.

 

while i havent customized any parameters of the Segmented control, still

1.on top there is lot white pixels - probably margin/padding etc

2. At the right side again there are lot of white pixels - ideally i would wish for it to occupy the whole width

3. There is no property to set the background color of the Segmented control.

 

 

Please use plain text.
BlackBerry Development Advisor
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Carrier: developer

Re: Segmented Control setting proper alignment, padding and background color

Can you post the qml for the page that has the segmented control?  I'm particularly interested in how the layout is done.  You can strip out any special handling like click handlers.  There may be some container background colour or some spaceQuota that should be set.

 

Stuart

Please use plain text.
BlackBerry Development Advisor
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Carrier: developer

Re: Segmented Control setting proper alignment, padding and background color

Look at sample BucketList for an example of SegmentedControl.  I expect in your case you need to use containers with background colours, and possibly set StackLayoutProperties spaceQuota on some expandable items so that extra whitespace is added or removed from the controls you intend, and the fixed sized controls remain the size you intend.

 

Stuart

Please use plain text.
Developer
rock_win
Posts: 134
Registered: ‎02-01-2009

Re: Segmented Control setting proper alignment, padding and background color

The sample hosted at:
https://github.com/blackberry/Cascades-Samples/blob/master/bucketlist/assets/main.qml

when tried on simulator has 2 main UI issues:
1.The segmented control is not horizontally centered , there is more space at right
2. the list view has a white header at the top ( try scrolling the list and you would observe it disappearing)

Can these be fixed by some way?
Please use plain text.
BlackBerry Development Advisor
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Carrier: developer

Re: Segmented Control setting proper alignment, padding and background color

I'm not seeing these issues.

 

Centering should be handled  by

                layoutProperties: StackLayoutProperties {
                    horizontalAlignment: HorizontalAlignment.Center
                }
There is a small margin around the segmented control; is this what you mean by a white header?
Can you post a picture?   This sample is behaving for me on both simulator and device.
(I downloaded the full set of samples from github https://github.com/blackberry/Cascades-Samples.git)
Stuart
Please use plain text.