[TIMOB-8245] Android: Button - Button will not auto resize to fit long text
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-03-26T13:05:16.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | n/a |
Components | Android |
Labels | parity, qe-and031912, qe-nfc |
Reporter | Wilson Luu |
Assignee | Marshall Culpepper |
Created | 2012-03-23T13:02:52.000+0000 |
Updated | 2017-03-09T23:23:50.000+0000 |
Description
Steps to reproduce:
1. Run the following code:
// Create 3 button on a parent that is width and height constrained with the following text:
// A
// Test
// VeryLongButtonText1234567890
// See that the button sizes itself accordingly
var win = Ti.UI.createWindow();
win.backgroundColor = 'white';
var label = Ti.UI.createLabel({
text: 'Buttons should auto size to text, but stay within red',
top: 20,
left: 10,
height: Ti.UI.SIZE,
width: Ti.UI.SIZE,
color: 'black'
});
// Short Test
var outlineView1 = Ti.UI.createView({
height: 62,
width: 152,
top: 80,
backgroundColor: 'red'
});
var view1 = Ti.UI.createView({
height: 60,
width: 150
});
var button1 = Ti.UI.createButton({
title: 'A'
});
view1.add(button1);
outlineView1.add(view1);
// Medium Test
var outlineView2 = Ti.UI.createView({
height: 62,
width: 152,
top: 180,
backgroundColor: 'red'
});
var view2 = Ti.UI.createView({
height: 60,
width: 150
});
var button2 = Ti.UI.createButton({
title: 'Test'
});
view2.add(button2);
outlineView2.add(view2);
// Long Test
var outlineView3 = Ti.UI.createView({
height: 62,
width: 152,
top: 280,
backgroundColor: 'red'
});
var view3 = Ti.UI.createView({
height: 60,
width: 150
});
var button3 = Ti.UI.createButton({
title: 'VeryLongButtonText1234567890 '
});
view3.add(button3);
outlineView3.add(view3);
win.add(label);
win.add(outlineView1);
win.add(outlineView2);
win.add(outlineView3);
win.open();
Actual: The last button does not auto fit the long text. See attachment.
Expected: The last button should auto fit the long text
Note:
* Above code works as expected on iOS.
Attachments
File | Date | Size |
---|---|---|
device-2012-03-23-140417.png | 2012-03-23T13:04:46.000+0000 | 43556 |
Also occurs on: Titanium Studio, build: 2.0.0.201203262445 SDK: 2.0.0.v20120325213306 Device: Android Nexus S (2.3.6)
This also occurs on Android(2.2.2) Nexus one when tested on Titanium mobilesdk-2.0.0.v20120325213306 Titanium Studio build: 2.0.0.201203262445
Android behavior is correct in this use case
Closing ticket as invalid.