Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Make a view or scrollview assume the height as available space

$
0
0

Hi all ! I've this scenario...

<Alloy>
    <Window class="container">
        <View id="client" class="rootView">
            <View id="iosStatusBar" platform="ios"/>
            <View class="header">
                <Label id="clientLabel" class="headerLabel">Header</Label>
            </View>
            <View class="subHeader">
                <Label>subHeader</Label>
            </View>
            <ScrollView class="contents">
                <Label>contents</Label>
            </ScrollView>
            <View class="footer">
                <Label>Footer</Label>
            </View>
        </View>
    </Window>
</Alloy>
 
".rootView": {
    layout: "vertical"
}
"#iosStatusBar" : {
    height: "40px",
    backgroundColor: "red"
}
".header" : {
    height : "10%",
    backgroundColor: "yellow"
}
".subHeader" : {
    height : "10%",
    backgroundColor: "green"
}
".contents" : {
    height : Ti.UI.SIZE,
    backgroundColor : "blue"
}
".footer" : {
    height : "10%",
    backgroundColor: "cyan"
}
as you can see...status bar, header, sub header and footer had fixed height. Contents has no fixed height. It's because the height itself must be the available space. so, the height must be something like device height - 40px - 10% - 10% -10%. Is there some how to do it using TSS only ? I mean..without perform calculations programmatically ?

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>