Guest User

Untitled

a guest
Feb 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. var win = Ti.UI.createWindow({
  2. backgroundColor:'#ccc'
  3. });
  4.  
  5. var label = Ti.UI.createLabel({
  6. height:'auto',
  7. bottom:-100,
  8. text:'',
  9. left:0,
  10. right:0,
  11. font:{
  12. fontSize:20,
  13. fontWeight:'bold'
  14. },
  15. backgroundColor:'#fff'
  16. })
  17.  
  18. var textArea = Ti.UI.createTextArea({
  19. height:40,
  20. bottom:0,
  21. width:320,
  22. value:'',
  23. suppressReturn:false,
  24. font:{
  25. fontSize:20,
  26. fontWeight:'bold'
  27. },
  28. backgroundColor:'#fff'
  29. });
  30.  
  31. win.add(label);
  32. win.add(textArea);
  33.  
  34. win.open();
  35.  
  36.  
  37. textArea.addEventListener('change', function(e){
  38. label.text = e.value+'something';
  39. textArea.height = label.toImage().height+10;
  40. });
Add Comment
Please, Sign In to add comment