Skip to content

Instantly share code, notes, and snippets.

@rblalock
Created April 4, 2014 17:50
Show Gist options
  • Save rblalock/9979577 to your computer and use it in GitHub Desktop.
Save rblalock/9979577 to your computer and use it in GitHub Desktop.
var Win = Ti.UI.createWindow({
title: "My Message",
});
var ScrollView = Ti.UI.createScrollView({
height: Ti.UI.FILL,
width: Ti.UI.FILL,
contentHeight: "100%",
contentWidth: "100%",
});
var TextArea = Ti.UI.createTextArea({
font: {
fontSize: 14
},
bottom: 40,
width: 250,
scrollable: false,
backgroundColor: "#00FF00",
height: "auto"
});
var InvisibleLabel = Ti.UI.createLabel({
font: {
fontSize: 14
},
width: 250,
height: "auto",
text: TextArea.value,
visible: false
});
TextArea.addEventListener("change", function(e) {
InvisibleLabel.text = e.value;
TextArea.height = InvisibleLabel.height;
});
ScrollView.add(InvisibleLabel);
ScrollView.add(TextArea);
Win.add(ScrollView);
Win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment