0

Here i am facing one problem,I need to change the Drop down option to align right.

now i am pushing the value like...

foreach (int key, map.keys()){
if(position ==1 && key >1000) {
    Option* option = Option::create();
    option->setText(map[key]);
    option->setValue(key);
    dropDown1->add(option);
    //dropDown1->setHorizontalAlignment(HorizontalAlignment::Right);
}else
    if(position ==2 && key < 1000) {
        Option* option = Option::create();
        option->setText(map[key]);
        option->setValue(key);
        dropDown1->add(option);
    }
}

and my qml is like

          Container {
            objectName: "DdContainer"
            layout: StackLayout {
                orientation: propertyMap.textSize.length == 6 ? LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight
            }

            topPadding: 20.0
            horizontalAlignment: HorizontalAlignment.Fill

            DropDown {
                // title: "Select Symbol"
                objectName: "myDropDown"
                enabled: true

                layoutProperties: StackLayoutProperties {
                    spaceQuota: 3.0
                }
            }
            Button {
                imageSource: "asset:///images/add_button.png"
                maxHeight: 100
                maxWidth: 100
                layoutProperties: StackLayoutProperties {
                    spaceQuota: 1.0
                }
                onClicked: {
                    _addOrDelRef.showSymbolsListView();
                    // _addOrDelRef.dropSymbols(1);
                }
            }

        }

if key is below 1000 align left otherwise align right.How to do that in bb 10 cascades...

Please help, Thanks...

Sharath
  • 315
  • 1
  • 3
  • 13

1 Answers1

0

The logic of alignment is here: orientation: propertyMap.textSize.length == 6 ? LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight

You need to change this value according to key

Benoit
  • 1,922
  • 16
  • 25