Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // test.js
- // Demonstrates:
- // Inconsistent selection highlighting for rows with child views (on Android)
- // Click on an empty part of the row: the row is selected and highlighted
- // Click on a label: the rows is still selected, but no highlighting
- var win = Ti.UI.createWindow({
- // for Android
- navBarHidden: false,
- // for Android root window
- exitOnClose: true
- });
- var view = Ti.UI.createTableView({
- backgroundColor: '#fff'
- });
- var row = Ti.UI.createTableViewRow({
- height: 70,
- rowName: 'This is the row'
- });
- var title = Ti.UI.createLabel({
- text: 'Title',
- font: {fontSize: 40, fontWeight: 'bold'},
- color: '#000',
- top: 5,
- left: 10,
- height: 40
- });
- var comment = Ti.UI.createLabel({
- text: 'Comment',
- font: {fontSize: 25},
- color: '#444',
- top: 45,
- left: 10
- });
- row.add(title);
- row.add(comment);
- view.data = [ row ];
- view.addEventListener('click', function(e) {
- var dlg = Ti.UI.createAlertDialog({
- title: e.row.rowName,
- buttonNames: [ 'OK' ]
- });
- dlg.show();
- });
- win.add(view);
- win.open();
Add Comment
Please, Sign In to add comment