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

add elements in the View through the Controller

$
0
0

Hi, there is my code>>

index.xml:

<Alloy>
    <Window class="container">
 
        <View id="view_header">
            <Label id="title"></Label>
        </View>
 
        <View id="view_body">
        </View>
 
    </Window>
</Alloy>
index.js:
$.title.text="hello word";
var button=[];
for (var i=0; i < 4; i++){
    button[i] = Titanium.UI.createButton({
        title: "item"+i,
        top: "6%",
        width:"100", 
        height:"50",
        font: {
            fontSize: 11,
            color:"#000",
            textAlign:"center"
        },
        backgroundColor: "#9DF"
    });
    $.view_body.add(button[i]);
}
$.index.open();
index.tss:
".container": {
    backgroundColor:"white",
    layout: "vertical"
}
"view_header": {
    backgroundColor:"white",
    layout: "vertical"
}
"view_body": {
    backgroundColor:"blue",
    layout: "vertical"
}
My problem: Always no show anything in view_body neither background blue.

Need your help! Thanks!


Viewing all articles
Browse latest Browse all 8068

Trending Articles



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