Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3548] Android: textArea in an alertDialog not visible if width is a percent

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-05-03T14:00:52.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.7.0, Sprint 2011-16
ComponentsAndroid
Labelsandroid, defect, klist, release-1.7.0, reported-1.6.1
ReporterJon Alter
AssigneeBill Dawson
Created2011-04-15T03:46:31.000+0000
Updated2011-05-03T14:00:52.000+0000

Description

A textArea in an alertDialog will not display until after you change orientation if the width is set to a percent. Will display fine if the width is static or not set.

Step 1: create a mobile project
Step 2: paste the example into your app.js
Step 3: launch the app on a android 1.6 device
Step 4: click the button
Step 5: notice that the alertDialog does not have a textArea in it
Step 6: change the orientation of the device
Step 7: notice that the textArea appears
Step 8: repeat the above steps but change the width:'90%' to width:120
Step 9: notice that textArea appears
Step 10: repeat the above steps on a non-1.6 device, and notice the textArea displaying when using a % for the width

var win = Ti.UI.createWindow({
        backgroundColor: 'yellow'
});

var view = Ti.UI.createView({
        backgroundColor: 'green'
});

var dialog = Titanium.UI.createAlertDialog({
   buttonNames : ['Save', 'Cancel'],
   title               : 'Edit task name',
   androidView   : view
});
    
var taskNameArea = Titanium.UI.createTextArea({
    width: '90%',
    // width: 120
});
view.add(taskNameArea);

var button = Ti.UI.createButton({
    title: 'click',
    height: 50,
    width: 100,
    top: 20
});
button.addEventListener('click', function(e){
    dialog.show();
});

win.add(button);
win.open();

Tested On

Display textArea

Nexus S 2.3.2 TiSDK 1.6.1
Emulator APIs 2.2 Screen HVGA TiSDK 1.6.1
Droid 2.2.1 TiSDK 1.6.1

Does Not display textArea until after orientation change

Emulator APIs 1.6 Screen QVGA TiSDK 1.6.1
Emulator APIs 1.6 Screen HVGA TiSDK 1.6.1
G1 1.6 TiSDK 1.6.1

Comments

No comments

JSON Source