Guan Chuan
Guan Chuan

Reputation: 661

Dynamic view in ScrollView

this question is related to smartface.io. I having some problem while implementing the slider drawer.

enter image description here This is the slider drawer that I used. When I touch on 3, there is a container will be shown.

enter image description here After I clicked, the slider drawer is closed. I tried to check slider drawer hide through onHide. However, the function not being called.

enter image description here I need to reopen the slider drawer. Then it only show me what I want.

enter image description here This is the structure of the elements

Here is the sample code:

var list = ["1","2","3","4","5","6","7"];
var catList = ["a","b","c","d","e","f","g","h","i","j","k","l"]
for(var item in list) {
    var label = new SMF.UI.Label({
        text : list[item],
        width: "100%",
        height: "100px",
        horizontalGap: "10dp"
    });
    if(list[item] === "3"){
        container = new SMF.UI.Container({
            width: "100%",
            height: (100 * catList.length) + "px",
            enabled: false,
            orientation: 1,
            layoutType: SMF.UI.LayoutType.linear
        });
        for(var catItem in catList){
            var catLabel = new SMF.UI.Label({
                text : catList[catItem],
                width: "100%",
                height: "100px",
                horizontalGap: "60dp"
            });
            container.add(catLabel);
        }
        label.onTouchEnded = function(e){
            container.visible = !container.visible;
        }
        Pages.HomePage.sdMenu.svMenu.ctnMenu.add(label);
        Pages.HomePage.sdMenu.svMenu.ctnMenu.add(container);
    }else{
        Pages.HomePage.sdMenu.svMenu.ctnMenu.add(label);
    }

The question is, How can I achieve that without closing the slider drawer? Thank you.

Upvotes: 0

Views: 106

Answers (1)

I tried this with your code, at the opening I got the exact screenshot3 that you get. I could see the catList open. Then I pressed 3, the catList was closed but the sliderDrawer was still open. I tried this a couple of times.

As I understood your problem is this; when you press 3, the sliderDrawer closes at the first time, after that when you open it again, it shows the screenshot3. If this is right, then can you please give the name of the device you use? If not, can you please describe again what you are trying to do?

Upvotes: 1

Related Questions