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

Adding a label to view at particular position

$
0
0

Hi i have following code my xml file

<Alloy>
    <Window id="flexipendingpositiondesc">
        <View id="headerview">
            <Label id="backlabel"></Label>
            <Label id="homelabel"></Label>
        </View>
        <View id="contentview">
            <ScrollView id="contentscrollview">
                <Label id="title">Title</Label>
                <View id="detailsview">
                    <View id="firstpartview">
 
                    </View>
                    <View id="secondpartview">
 
                    </View>
                </View>
            </ScrollView>
        </View>
    </Window>
</Alloy>
my js file
var descriptionlabel = Alloy.Globals.StyledLabel.createLabel({
    top : "2%",
    left : "2%",
    font : {
        fontSize : Alloy.Globals.smallfont
    },
    //color : "#000",
    html : Ti.App.Properties.getObject("position")[Ti.App.Properties.getString('row')].position.position_description
 
});
 
$.contentscrollview.add(descriptionlabel);
my tss file
"Label": {
    font:{
        fontFamily: 'Ubuntu-C'
    },
    color: "#000"
},
"#flexipendingpositiondesc":{
    backgroundColor: "#fff",
    navBarHidden: true,
    layout: "vertical",
    //exitOnClose: true,
    modal: true
},
"#flexipendingpositiondesc[platform=ios]":{
    backgroundColor: "#fff",
    layout: "vertical",
    top: 20,
    modal: true
},
"#headerview":{
    height: "10%",
    backgroundColor: "#428BA4"
},
"#labelvolunteer":{
    color: "#fff",
    font:{
        fontSize: Alloy.Globals.font,
        fontWeight: "bold"
    }
},
"#backlabel":{
    left: "10%",
    color: "#fff",
    text: Alloy.Globals.icons.chevron_sign_left,
    font: {
        fontFamily: 'AppIcons',
        fontSize: Alloy.Globals.widgetfont,
        fontWeight: "bold"
    }
},
"#homelabel":{
    right: "10%",
    color: "#fff",
    text: Alloy.Globals.icons.home,
    font: {
        fontFamily: 'AppIcons',
        fontSize: Alloy.Globals.widgetfont,
        fontWeight: "bold"
    }
},
"#contantview":{
    height: "90%",
    layout: "vertical"
},
"#contentscrollview":{
    height: "100%",
    layout: "vertical",
    scrollType: "vertical",
    showVerticalScrollIndicator: true
},
"#positiontitle":{
    top: "2%",
    left: "5%",
    color: "#003366",
    font:{
        fontSize: Alloy.Globals.font,
        fontWeight: "bold"
    }
},
 
"#detailsview":{
    top: "5%",
    height: "50%",
    layout: "horizontal"
},
"#firstpartview":{
    height: "100%",
    width: "50%",
    ///backgroundColor: "pink",
    layout: "vertical"
},
 
"#secondpartview":{
    height: "100%",
    width: "50%",
    //backgroundColor: "blue",
    layout: "vertical"
}
my problem is i'm using layout for my view as vertically. What i want is the description label which i had declared in js file need to append after title label and before detailsview. But is appending at the bottom of the view.how can i append in my required position??

as i have used styled label module because i'll be getting response in rich text formate or else please help me how can i declare styled label in alloy xml.

working on both platforms ios and android , titanium latest sdk 3.3.0

Thanks


Viewing all articles
Browse latest Browse all 8068

Trending Articles