1
votes

I am developing an multi-platform App for iOS and Android in Titanium Studio. I need to spread listView in Windows like this:

what I mean

Image, "Some text" and Footer with button should have static height (depended on height of its (sub)elements) and the remaining part of screen will be listView.

Is it possible? How? I tried to make tableView, or tried to detect height of the screen also, but with no luck.

Now I'm tring:

body = Ti.UI.createView({
            width:'100%',
            height:'100%',
            bottom: 0,
            top: 0,
            left: 0,
            right: 0,
            layout:'vertical',
                        borderColor: '#000000',
            borderWidth: 2,
            bottom: 0,
            left: 0,
            right: 0,
    });

....



  subbody = Ti.UI.createView({
                height:200,
                layout:'vertical',
                borderColor: '#000000',
                borderWidth: 2,
                bottom: 0,
        });


    var createButton = new Ti.UI.createButton({
        id:'createButton',
        title: 'Vytvorit novy', 
        bottom: 0   
    });
    var notfoundLabel = new Ti.UI.createLabel({
        text: "Nebolo najdene",
        height: '100',
        width: '100%'
    });
    subbody.add(createButton);
    subbody.add(notfoundLabel); 
    body.add(subbody);

But it looks like (i have one more element on top (IMAGE)):

how it looks like

1
I found the problem with: layout: 'vertical', but now it overflows throughTomasz

1 Answers

0
votes

As you said that some text and Footer have a static height,you should set top and bottom of listview . In this way you can set listview in remaining area.