[TIMOB-5309] iOS: TextField maxLength Property
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2011-09-20T10:15:47.000+0000 |
| Affected Version/s | Release 1.8.0 |
| Fix Version/s | Sprint 2011-37, Release 1.8.0 |
| Components | iOS |
| Labels | branch-5062, module_textfield, qe-testadded |
| Reporter | Dawson Toth |
| Assignee | Stephen Tramer |
| Created | 2011-09-20T03:22:18.000+0000 |
| Updated | 2014-06-19T12:46:43.000+0000 |
Example code:
var win = Ti.UI.createWindow({ backgroundColor:'white' }); var tf = Ti.UI.createTextField({ value:'SAMPLE', maxLength:20, top:20, left:20, width:300, height:60, borderStyle:Ti.UI.INPUT_BORDERSTYLE_ROUNDED }); win.add(tf); var b = Ti.UI.createButton({ title:'Increase maxLength', width:200, height:40, bottom:60 }); b.addEventListener('click', function(e) { tf.maxLength += 5; Ti.API.info('maxLength: '+tf.maxLength); }); win.add(b); var b2 = Ti.UI.createButton({ title:'Unlimited length', width:200, height:40, bottom:120 }); b2.addEventListener('click', function(e) { tf.maxLength = -1; }); win.add(b2); win.open();Tested with 1.9.0.v20120207171634 on iPad 2(5.0.1)