Guest User

Untitled

a guest
Oct 23rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1.  
  2. // test.js
  3.  
  4. // Demonstrates:
  5. // Inconsistent selection highlighting for rows with child views (on Android)
  6.  
  7. // Click on an empty part of the row: the row is selected and highlighted
  8. // Click on a label: the rows is still selected, but no highlighting
  9.  
  10. var win = Ti.UI.createWindow({
  11. // for Android
  12. navBarHidden: false,
  13. // for Android root window
  14. exitOnClose: true
  15. });
  16.  
  17. var view = Ti.UI.createTableView({
  18. backgroundColor: '#fff'
  19. });
  20.  
  21. var row = Ti.UI.createTableViewRow({
  22. height: 70,
  23. rowName: 'This is the row'
  24. });
  25.  
  26. var title = Ti.UI.createLabel({
  27. text: 'Title',
  28. font: {fontSize: 40, fontWeight: 'bold'},
  29. color: '#000',
  30. top: 5,
  31. left: 10,
  32. height: 40
  33. });
  34.  
  35. var comment = Ti.UI.createLabel({
  36. text: 'Comment',
  37. font: {fontSize: 25},
  38. color: '#444',
  39. top: 45,
  40. left: 10
  41. });
  42.  
  43. row.add(title);
  44. row.add(comment);
  45.  
  46. view.data = [ row ];
  47.  
  48. view.addEventListener('click', function(e) {
  49. var dlg = Ti.UI.createAlertDialog({
  50. title: e.row.rowName,
  51. buttonNames: [ 'OK' ]
  52. });
  53. dlg.show();
  54. });
  55.  
  56. win.add(view);
  57. win.open();
Add Comment
Please, Sign In to add comment