Hi, I need some hints from you guys. Actually I'm having one tableview row and one image and 2 labels ,image and labels I have added to tableviewrow. and trying to do align the labels based on image .Here image is not there in the row , the labels has to move to the image place can any one guide me please and I wrote the code like this
index.xml
<TableView id="listtable"> <TableViewRow id="listtablerow1" > <ImageView id="listimage1" /> <Label id="title2" >News 1</Label> <Label id="subtitle1">Established in 1999,.</Label> <View id="rowline"></View> </TableViewRow> <TableViewRow id="listtablerow2" > <ImageView id="listimage2" /> <Label id="title3" >News 2</Label> <Label id="subtitle2" >Perfint’s newest product MAXIO,.</Label> <View id="rowline"></View> </TableViewRow> </TableView>and index.js
var newsviewheight = $.listimage1.toImage().width; //--subtitle height --// var newstitleheight = $.title2.toImage().height; $.title2.top = $.listimage1.left-10; $.title2.left = $.listimage1.left+$.listimage1.width+20; $.subtitle1.top = $.title2.top+newstitleheight; $.subtitle1.left = $.listimage1.left+newsviewheight+20; $.title3.top = $.listimage2.left-10; $.title3.left = $.listimage2.left+$.listimage2.width+20; $.subtitle2.top = $.title3.top+newstitleheight; $.subtitle2.left = $.listimage2.left+newsviewheight+20;and index.css
//----news table line separator--// "#listtable":{ separatorColor:"transparent" } //--row line for table row separators --// "#rowline":{ height:"1dp", width:Alloy.CFG.Width, backgroundColor:'#765A42', top:"97%" } //-----news table row1 ---// "#listtablerow1":{ height:Alloy.CFG.iheight, } //-----news table row1 ---// "#listtablerow2":{ height:Alloy.CFG.iheight, } //---news row image ---// "#listimage1":{ image: '/images/p2.jpg', width: Alloy.CFG.newsimage, height:"80%", left:Alloy.CFG.lviewleft, borderWidth:"2dp", borderColor:"#5b5959", } "#listimage2":{ image: '/images/p1.jpg', width: Alloy.CFG.newsimage, height:"80%", left:Alloy.CFG.lviewleft, borderWidth:"2dp", borderColor:"#5b5959", } //--news title --// "#title2":{ color:"#000", //top:"10%", width:Alloy.CFG.newstextwidth, height:"auto", font: { fontFamily:'Arial', fontSize: Alloy.CFG.font1, fontWeight:'bold' }, } "#title3":{ color:"#000", //top:"10%", width:Alloy.CFG.newstextwidth, height:"auto", font: { fontFamily:'Arial', fontSize: Alloy.CFG.font1, fontWeight:'bold' }, } //---news subtitle--// "#subtitle1":{ color:"#000", //top:"10%", width: Alloy.CFG.newstextwidth, height:"30%", font: { fontFamily:'Arial', fontSize: Alloy.CFG.font1, fontWeight:'normal' }, } "#subtitle2":{ color:"#000", //top:"10%", width: Alloy.CFG.newstextwidth, height:"30%", font: { fontFamily:'Arial', fontSize: Alloy.CFG.font1, fontWeight:'normal' }, }