Created
March 7, 2013 20:41
-
-
Save alanleard/5111617 to your computer and use it in GitHub Desktop.
Dynamic height
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win = Ti.UI.createWindow(); | |
var leftTileView = Ti.UI.createView({ | |
backgroundColor:"red", | |
height:(Math.random()*200), | |
width:"59%", | |
left:0 | |
}); | |
var tileContainer = Ti.UI.createView({ | |
height:Ti.UI.SIZE, | |
width:Ti.UI.FILL, | |
borderWidth:2, | |
borderColor:"red" | |
}); | |
tileContainer.add(leftTileView); | |
win.add(tileContainer); | |
var rightTileView = Ti.UI.createView({ | |
width:"41%", | |
right:0, | |
height:Ti.UI.FILL | |
}); | |
var rightTopTile = Ti.UI.createView({ | |
backgroundColor:"blue", | |
top:0, | |
height:"50%" | |
}); | |
var rightBottomTile = Ti.UI.createView({ | |
backgroundColor:"green", | |
bottom:0, | |
height:"50%" | |
}); | |
setTimeout(function(){ | |
rightTileView.height = tileContainer.size.height | |
tileContainer.add(rightTileView); | |
rightTileView.add(rightTopTile); | |
rightTileView.add(rightBottomTile); | |
}, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment