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
HuXu77
Posts: 196
Registered: ‎02-10-2011
My Device: Playbook 16GB and Z10
My Carrier: Verizon
Accepted Solution

DateTimePicker preferredWidth doesn't shorten drop down

[ Edited ]

I have done the following:

 

DateTimePicker {
              preferredWidth: 570
              title: "Summary for:"
              maxWidth: 570
}

 It shortens the field but not the drop down box.  How do I get the whole thing to be a certain width?

 

Also how can we change the color schemes on these items?  Like in the API it has a white themed date time picker.

_________________________________________________
Apps
Go Music
Flashlight Fast Free/Pro
Fitbit for BlackBerry PlayBook
Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: DateTimePicker preferredWidth doesn't shorten drop down

[ Edited ]

I added:

            preferredWidth: 570
            maxWidth: 570
to the DateTimePicker.qml of cascadescookbookqml.

I also removed all of the rest of that DateTimePicker.

 

This affects both the widget width and the dropdown width, which is not what you describe.

 

Can you show the full page containing your full DateTimePicker and show how this is different from the one in cascadescookbookqml?

(Better yet, what changes do you need to make to DateTimePicker.qml of that project to demonstrate your issue? Perhaps this has something to do with the container)

 

Note: Some of us would like to know how to independently control the control width vs. the drop width, so please let me know how you achieved that.

 

Stuart

Please use plain text.
Developer
HuXu77
Posts: 196
Registered: ‎02-10-2011
My Device: Playbook 16GB and Z10
My Carrier: Verizon

Re: DateTimePicker preferredWidth doesn't shorten drop down

[ Edited ]

Hmmm well after reading your post I decided to try to give the preferred and max width to the container it was in but that didn't seem to help either

 

Here is the full code:

 

Container {
                        id: body
                        layout: StackLayout {}
                        translationX: 50
                        translationY: 200
                        preferredWidth: 570
                        maxWidth: 570
                        DateTimePicker {
                                preferredWidth: 570
                                title: "Summary for:"
                                maxWidth: 570
                        }
                        Label {
                              text: "Total Steps: 21340"
                              textStyle {
                                     base: SystemDefaults.TextStyles.TitleText
                                     fontWeight: FontWeight.Light
                                     color: Color.Black
                              }                       
                       }
                       Label {
                           text: "Total Miles: 12304"
                           textStyle {
                                base: SystemDefaults.TextStyles.TitleText
                                fontWeight: FontWeight.Light
                                color: Color.Black
                           }   
                       }
                    }

 

And here is a screenshot of what happens when I run it on the Dev Alpha 

The year column is cut off

 

Screenshot and this is of it  closed

 

edit: fixed the closed link (was broken)

_________________________________________________
Apps
Go Music
Flashlight Fast Free/Pro
Fitbit for BlackBerry PlayBook
Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: DateTimePicker preferredWidth doesn't shorten drop down

I see I misread your original post.  This is clear.

Your issue is the year column is dropped instead of automatic font change or column widths adjusted.

Yes, that is what I was seeing yesterday too.  I will continue to investigate, but suspect we will need to report an issue in the issue tracking system.

 

Stuart

 

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

Re: DateTimePicker preferredWidth doesn't shorten drop down

UI guidelines suggest not using lots of margin and whitespace.

Can you get away with a width of 670 for now?

 

Stuart

Please use plain text.
Developer
HuXu77
Posts: 196
Registered: ‎02-10-2011
My Device: Playbook 16GB and Z10
My Carrier: Verizon

Re: DateTimePicker preferredWidth doesn't shorten drop down

Yea, I can do 670 for now.

_________________________________________________
Apps
Go Music
Flashlight Fast Free/Pro
Fitbit for BlackBerry PlayBook
Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: DateTimePicker preferredWidth doesn't shorten drop down

DateTimePicker is designed to be full length but accomodate an action bar.

If you need more, you could consider adding a feature request.

 

Stuart

 

Please use plain text.