Nested in ScrollView containers

Hey guys,.

I make a list of containers that I'm trying to display on the screen, with the ability to scroll to the bottom of the list. I have a number of containers, which are all added to a container operation that I then put in a ScrollView. Container operation is much too big for the screen, but does not scroll, even inside the ScrollView.

I know that there is already a ListView that does almost exactly what I need, but I need a much more dynamic access to modify the list as ListView offers.

Here is a basic version of the code that I am running:

Container* mainContainer = new Container();
Container* listContainer = new Container();

Container* headerContainer = new Container();
Label* headerLabel = new Label();
headerLabel->setText("Header");
headerLabel->textStyle()->setFontWeight(FontWeight::Bold);
headerLabel->textStyle()->setFontSize(FontSize::XLarge);
headerContainer->add(headerLabel);

for(int i = 0; i < 100; i++){
    Label* label = new Label();        Container* labelContainer = new Container();
    label->setText(QString::number(i));        labelContainer->add(label);
    listContainer->add(labelContainer);
}

ScrollView* scrollView = ScrollView::create().content(listContainer);

mainContainer->add(headerContainer);
mainContainer->add(scrollView);

page->setContent(mainContainer);

If I just add the ScrollView directly to the page, without the parent containers then he reproduces very well and allows lots of scroll the list of labels. However, once the ScrollView is added to the mainContainer and which is defined as the content of the Page, it is no longer made scroll.

Any suggestions?

Hey there...

In fact, it works. It's just that your ScrollView is as wide as the numbers are... Or rather as wide as your label, which holds numbers... Try to add the following property to your ScrollView...

   ScrollView* scrollView = ScrollView::create()
        .content(listContainer)
        .horizontal(HorizontalAlignment::Fill);

Tags: BlackBerry Developers

Similar Questions

  • Update the Text property in other containers

    Calling all Flexpertz!

    Hi, I'm trying to update a text property of the textarea with ActionScript that I've nested inside a vbox, within a Panel, inside a canvas.  When debugging, I noticed that the textarea object is null if its nested in other containers.  But if I allow it to be outside, I can put the text very well.

    TypeError: Error #1009: cannot access a property or method of a null object reference.
    to...

    Any ideas?

    You want creationPolicy = "all", although its use is considered as anti-corporate good practices. Best practices has you the initialization of the components needed on creationComplete for the TabNavigator, but which can be annoying.

    If this post answers your question or assistance, please mark it as such.


    creationPolicy = "all" >

  • Problem with TextArea with scrolling

    Hi all

    In my application I use qml custom page (simple text editor) that have only one line with 5 buttons, second row have a textField and the rest of the screen is TextArea, nested/arranged in containers bit. Content of the text box is filled by reading text file:

    I use

    QTextStream in(&file);
    while (!in.atEnd()) {
    textHolder->setText(in.readAll().toUtf8());
    

    But, sometimes, text is passed in a single line in the text box, even if the file contains more lines, spaces etc. I used the same code for plain program Qt and the content of the file is displayed as shown in the text file.

    Following problem, after the filling of the text box visible set with input from the keyboard, the TextArea scrools automatically, but up to a certain number of lines of text (10 +-) and it borders them. I cannot scrool it up nor down. With the help of resetText() resets the content of the static text, but does not return to the top. Tried to use the ScrollView, but without success. It's preety * beep * useless.

    In addition, when the virtual keyboard appears, top of TextArea overlaps the textlabel. Had no idea how to solve this problem.

    I did the same thing in Qt for the PB and it works without problem, but stunts gives me headaches

    Here is my qml file

    import bb.cascades 1.0
    import Dialog.FileBrowse 1.0
    import Dialog.FileSave 1.0
    
    Page {
       content:
       Container {
            layout: StackLayout {
            }
    
        //main container
        Container {
                layout: StackLayout {
                    layoutDirection: LayoutDirection.LeftToRight
                    bottomPadding: 5.0
                    leftPadding: 5.0
                    rightPadding: 5.0
                    topPadding: 5.0
                }
              //  scrollMode: ScrollMode.None
                Button {
                    objectName: "open"
                    text: "Open"
                    onClicked: {
                        filebrowseDialog.show();
                    }
                    attachedObjects: [
                        FileBrowseDialog {
                            id: filebrowseDialog
                            objectName: "fb"
                            multiselect: false
                            filters: [
                                "*.doc",
                                "*.txt",
                                "*.html",
                                "*.htm",
                                "*.dat",
                                "*.php",
                                "*.*"
                            ]
                            onSelectionCompleted: {
                                if (filebrowseDialog.filepaths.length > 0) {
                                    labelID.text = filebrowseDialog.filepaths[0];
                                    cs.on_openButton_clicked(filebrowseDialog.filepaths[0]);
                                } else {
                                    labelID.text = "Nothing selected";
    
                                }
                            }
                            onSelectionCancelled: {
                               // labelID.text = "File open cancelled";
    
                               //simulator test, comment it out for release!!!
                               labelID.text = "no REAL file selected";
                               cs.on_openButton_clicked("test.txt");
                            }
                        }
                    ]
                }
                Button {
                    objectName: "close"
                    text: "Clear"
    
                }
                Button {
                    objectName: "save"
                    text: "Save"
    
                }
    
                Button {
                    objectName: "saveAs"
                    text: "Save As.."
                    attachedObjects: [
                                        FileSaveDialog {
                                            id: filesavedialog
                                            objectName: "fs"
                                           // filesave_filename: "test.txt"
    
                                            onSelectionCompleted: {
                                                labelID.text = "Saved to: " + filesavedialog.filepaths[0];
                                                cs.on_saveAsButton_clicked(filesavedialog.filepaths[0]);
                                        }
                                        }
                                    ]
                                    onClicked: {
                                        filesavedialog.show();
                                    }
                }
                Button {
                    objectName: "exit"
                    text: "Exit"
                }
            }
            Container {
                leftMargin: 0.0
                layout: StackLayout {
                    leftPadding: 5.0
                    rightPadding: 5.0
                    bottomPadding: 5.0
                }
                Label {
                    id: labelID
                    objectName: "documentName"
                    text: ""
                    layoutProperties: StackLayoutProperties {
                        verticalAlignment: VerticalAlignment.Center
                        horizontalAlignment: HorizontalAlignment.Center
                    }
                }
                ScrollView { id: scrollableTextHolder scrollViewProperties.scrollMode: ScrollMode.Vertical Container { TextArea { objectName: "contentHolder" inputMode: TextAreaInputMode.Text preferredWidth: 1270.0 minWidth: 1270.0 maxWidth: 1270.0 preferredHeight: 590.0 minHeight: 590.0 //maxHeight: 2048.0 } } }
            }
        }
    }
    

    Sorry for the late reply, I've corrected the problem last night. Read the file with this

    QTextStream in(&file);
    textHolder->setText(in.readAll());
    

    or this

    QString line = "";
    QChar theChar;
    while (!in.atEnd()) {
    in.operator >>(theChar);
    qDebug() << "text redden(QChar): " << theChar << endl;
    qDebug() << "character is(category): " << theChar.category() << endl;
    line.append(theChar);
    }
    textHolder->setText(line);
    

    Returns the integer values of whitespace and newline characters are OK. Problem saving the contents of the file.

    Somehow QTextStream recognizes the line break characters and spaces like [QChar:eparator_Space7Unicode Zs class name] and [QChar:ther_Control10Unicode name of the class Cc] that are correct but refuses to write them to the file.

    I used this to solve my problem.

    QTextStream out(&file);
                for(int i=0;itext().length();++i){
                                        qDebug() << "text to be written: " << QChar(textHolder->text().at(i)) << endl;
                                        qDebug() << "character is(category): " << textHolder->text().at(i).category() << endl;
                                        if(textHolder->text().at(i).category() == 10){
                                        out << "\n";
                                        }
                                        else{
                                            out << textHolder->text().at(i);
                                        }
                                    }
                out.flush();
    
  • ScrollBar of nested containers

    Look at this simple component:

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:VBox xmlns:mx = ' http://www.adobe.com/2006/mxml " width ="400"height ="300"horizontalAlign ="center">
    < mx:Label text = "Title" / >
    < mx:Box id = "gridBox" width = "100%" height = "100%" >
    < mx:DataGrid id = "grid" height = "100%" width = "100%" >
    < / mx:DataGrid >
    < / mx:Box >
    < mx:Button label = "Button" click = "grid.width = grid.width * 2" / >
    < / mx:VBox >

    When I click the button, the grid grows larger that the component and a scroll bar appears at the level of the components: in other words, it scrolls the title, the grid and the button.
    I want to force the scrollbar to appear inside gridBox, while only the grid be affected when scrolling.
    How is that possible?

    Thank you
    Luca Bortot

    I'm not explaining myself clearly: I want to leave the grid are growing and pan on it through its container direct scrollbars.
    Yet, your index won: I put the * width of the container * a (related) "fixed" value and he did.

    Thank you

  • Try to get segmentedControl to switch between containers

    Hi all

    I try to get a segmentedControl to toggle the visibility of two separate containers, driverBioText and driverStatsList. I'm going to paste my code, and maybe someone can point out what I am doing wrong? I'm still a noob to programming.

    ------

    {SegmentedControl}
    ID: segmentedDrivers
    Option {}
    ID: biography
    text: 'biography '.
    value: 'biography '.
    selected: true
    }
    Option {}
    ID: statistics
    text: 'statistics '.
    value: 'statistics '.
    }
    onSelectedIndexChanged: {}
    var value = segmentedDrivers.selectedValue)
    Console.Debug ("value:" + value);
    If (value = "biography") driverBioText.visible = true()
    else driverStatsList.visible = true()
    }
    }

    {Of container
    ScrollView {}
    TextArea {}
    ID: driverBioText
    rightPadding: 30.0
    leftPadding: 30.0
    visible: false
    editable: false
    topMargin: 10.0
    }

    }
    }

    {Of container

    ScrollView {}
    TextArea {}
    ID: driverStatsList
    rightPadding: 30.0
    leftPadding: 30.0
    visible: false
    editable: false
    topMargin: 10.0
    text: "pilot statistics".
    }
    }
    }

    -----

    Thank you!

    If theres no error in the console? And it will print "selected value: biography"? I'm also right in the docs that selectedValue is a property, not a method, in order to take the () off .selectedProperty too

    Im not 100% know javascript, so I don't know what is the exact syntax but id to write that if block like that for readability
    If (value == "biography") {}
    driverBioText.visible = true;
    driverStatsList.visible = false;
    } else {}
    driverBioText.visible = false;
    driverStatsList.visible = true;
    }

  • Is it necessary to use containers of div in addition to structure insert parts?

    Many experienced web developers use div containers for some of the main structures such as body, header, footer etc to style sections. With the insert function in DW which is necessary or is it advisable to nest a div container inside the tags structure or vice versa?

    for example:

    <>footer

    < div id = "footercontainer" >

    content

    < / div >

    < / footer >

    or

    <>footer

    content

    < / footer >

    It is advisable to nest a div container inside the structure tags

    I don't think anyone has directly addressed the question of the OPs. So here it is:

    Elements semantic as

  • Cannot drag and drop into the container of nested group

    I want to drag a component in a group container that is nested within another container of group, but I found that I can't do that. If I remove the parent group, drag operation is ok. And if I replace the two containers of BorderContainer group, drag the behavior is normal, too. I am confused with this problem. I use the group container because I want to use the wheel to implement the scroll bar feature. My version of the flex sdk is 4.1. Are there solutions? Thank you

    Try the code below.


    http://ns.Adobe.com/MXML/2009.
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx" width = "800" height = "600".
    xmlns:view = "org. "" BlueWolf.topo.View. * "xmlns:ilog ="http://www.ilog.com/2007/ilog/flex">."
       
           
       

       
       
            Import mx.core.DragSource;
    Import mx.events.DragEvent;
    Import mx.managers.DragManager;
               
    private void onMouseMove(e:MouseEvent):void {}
    var di: Button = e.currentTarget you Button
    var ds:DragSource = new DragSource();
    ds.addData (di, "dragTarget");
    ds.addData ({x: di.mouseX, y: di.mouseY}, "mouse");
    DragManager.doDrag (di, ds, e);
    }
               
    private void onDragEnter(e:DragEvent):void {}
    DragManager.acceptDragDrop (e.currentTarget as a group);
    }
               
    private void onDragDrop(e:DragEvent):void {}
    var dataObj:Object = e.dragSource.dataForFormat ("mouse");
    var dragNode:Button = e.dragInitiator as Button
    dragNode.x = this.mouseX - dataObj.x;
    dragNode.y = this.mouseY - dataObj.y;
    }
               
    ]]>
       

       
       
       

       
       
           
               
                   
               

           

       

    I changed the code to listen for the event dragEnter and dragDrop for the parent group container.

    Kind regards

    Anitha

  • Cam nest excluded Homekit?

    I can only assume, because of the competitive relationship between Apple and Google, but I'm really disappointed to see that the family of nest products is excluded from Homekit.

    Stupid decision, because I do not know that I am not alone to already incorporate the nest in my house and using the app to nest on my phone.  I guess they wanted to be sure that homekit was completely irrelevant for me...

    Google and nest products are in direct competition with Apple and their proprietary Home Kit.  Google paid $3 .2b for nest laboratories and has used to launch Google home.  Completely secure communication protocols different use of two technologies, so are not inherently compatible and nest will be redesigned specifically to be. Google doesn't want you to use the nest with home kit - they want to you use the nest with their system.  Time will tell which competitor wins in the end.

  • Can I create nested address lists?

    I want to create a game of skill nested lists so that I can manage a group large enough contacts in an organization of volunteers with a hierarchy, much like how I manage contacts work with MS Outlook (sorry for mentioing the competition!). I tried to add an existing list (let's call it List1) on a new list (let's call List2) which must also conduct additional individual contacts. When I do this, "List2" shows the individual contacts and "List1" when I select for the ' to: ' line in a new email, "List2" seems OK, but when I send the mail it is sent only to individuals and does not go to the members of "List1".
    I do something wrong or Thunderbird does not support this?

    There is a bug, ask the nested lists, but he's 15, ranked when he still was Netscape. https://Bugzilla.Mozilla.org/show_bug.cgi?id=40301

    More importantly, it is in the list of features for all. https://Bugzilla.Mozilla.org/show_bug.cgi?id=841598
    And important blog posts to explain it. http://mikeconley.ca/blog/tag/ensemble/

  • Cannot find the libraries/containers group

    I'm running my Word 2016 startup folder manually in order to make my word of Zotero plugin appear. Instructions (https://www.zotero.org/support/windows_word_plugin_manual_installation_instructi ons #macword_2016) tell me to run the start-up folder for something in ~Library/Group containers / etc etc, but I can't find the containers group file in my folder of library or ANYWHERE at ALL. I use a Mac to mid-2012 running Yosemite 10.10.5. I would appreciate help find my group containers folder or find how to get my plugin Zotero toolbar appears on my word 2016.

    You're looking in the right folder of the library. You want the folder/Home/Library/who is invisible.


    Three ways to make the House/library folder Visible

    A. this method will make the folder visible permanently. Open the Terminal application in the Utilities folder, and paste the following at the command prompt:

    chflags nohidden ~/Library

    Press RETURN.

    B. click on the desktop, press the Option (⌥) key, select library in the Finder menu go.

    C. go to the folder in the Finder menu select go. Paste the following text in the path field:

    ~/Library

    Click the OK button.

    [Permission to use any part of the foregoing has been granted by khati, exclusively, to theratter.]

  • Is it possible to run flash applications in different containers-plugin?

    I usually 3-4 open windows of firefox with several tabs in each window. There are at least 3 or 4 applications running at the same time flash. Thus, when an application crashes and plugin-container fails, I lose progress for each application. Now, I think, this opening a flash plugin-container for each flash application can help me with this. But I can't find any information how I can do it.

    I do understand that there may be tons of flash content on each web page, and so it would be nice to have an option to run only selected app in different containers. Can I do now? Or I'll be able to do in the future? Otherwise it's ok, just sad =)

    No, it currently is not possible and would not be without a significant overhaul of the plugin container architecture. My suggestion, keep Flash up to date, keep Firefox updated, and if you experience flash crashes, we can try to help you diagnose the.

  • Firefox starting with window nested after update to v.25.0

    When I start Windows Firefox start with nested window interface. If I close and run firefox again starts just fine.

    http://easycaptures.com/FS/uploaded/809/5563680305.PNG

    I found the reason of this problem.
    Tab Mix more-> Enable crash recovery.
    Problem has been resolved by disabling this option.

  • an easy way to bookmark, choose a nested folder structure

    When you choose bookmarks to a nested folder, it becomes a bit of a chore because you need to click on in the same way in the folder for each selected bookmark.

    Internet Explore has the ability to retain the folder chosen last bookmark of and offer this same folder again when you click the bookmarks for 2nd time button and the following.

    Firefox to be able to open all the bookmarks (in the form of hyperlinks) in a html window. It is no longer possible.

    I know that you can open all the bookmarks in a folder in tabs separated with a single command, but this isn't really what I want.

    You have 2 options:

    1. Use the bookmarks - CTRL + B to toggle the bookmarks open or closed bar. So the path to the nested folder remains open in the sidebar until you close the path by using the "-" to the left of the nested folders.
    2. To display the list of bookmarks HTML in a tab, type chrome://browser/content/bookmarks/bookmarksPanel.xul in the address bar in an empty tab. You can also set a bookmark or your home page to do this for you.
  • Why is my mail downloads enter this obscure chain of records?  / Library/containers/com. Apple.Mail/Data/Library/Mail downloads.

    I've had trouble finding my mail app downloads.  First of all, they won't in the 'Mail download' folder located in my Finder window.  Sometimes they are found in the "Downloads" folder  Other times, I can't immediately find their.  But if I search the name of the file, I noticed that my downloads in my mail application will in a download folder.  But this case is dark, buried somewhere deep in a series of folders.  Here is the chain of records for a recently downloaded file: downloads/F6320D5C-E169-47E8-9A09-00c408F1422D of tlynch/library/containers/com.apple.mail/data/library/mail.

    When I look in this folder downloads deep within this chain (and from com.apple.mail...), I find that some first downloads have been stored there directly.  But there are about two and a half years each downloaded file started being placed in a separate folder.  And the names of these folders are a long string of 32 alphanumeric characters.

    Are these folders the actual location of the files?  I can remove them?

    Can I reset the download destination? The pointer to the location of storage in the messaging application has been corrupted? Or I need to reinstall the program?

    Thanks for your help.

    This obscure folder structure is the usual place for downloading attachments in the Mail and most other e-mail clients.

    When you choose 'Download' the attachment, the file will be saved by default to the location defined in Mail-> Preferences-> general.

  • Firefox 8 displays the source at insead nested HTML IFRAME

    I got IFRAME nested for a few years, Firefox and other browsers display them without problems, but today with Firefox 8, I see the HTML source of the embedded iframe. My test scenario had a graph of Google in it, but because it is only the display of the HTML, I guess that the content makes no sense. I was about to create a test scenario, but I found that my editor (tinymce) is a failure also probably for the same reason.

    Looks like I answered my own question. The nested iframe did not have a header. Once I added my standard header, it worked. Firefox should get selector on the headers in the iframes.

Maybe you are looking for