Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-3548

Android: textArea in an alertDialog not visible if width is a percent

    Details

      Description

      {html}<div><p>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.</p>
      <p>Step 1: create a mobile project<br>
      Step 2: paste the example into your app.js<br>
      Step 3: launch the app on a android 1.6 device<br>
      Step 4: click the button<br>
      Step 5: notice that the alertDialog does not have a textArea in
      it<br>
      Step 6: change the orientation of the device<br>
      Step 7: notice that the textArea appears<br>
      Step 8: repeat the above steps but change the width:'90%' to
      width:120<br>
      Step 9: notice that textArea appears<br>
      Step 10: repeat the above steps on a non-1.6 device, and notice the
      textArea displaying when using a % for the width</p>
      <pre>
      <code class="javascript">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();</code>
      </pre>
      <h3>Tested On</h3>
      <h5>Display textArea</h5>
      <p>Nexus S 2.3.2 TiSDK 1.6.1<br>
      Emulator APIs 2.2 Screen HVGA TiSDK 1.6.1<br>
      Droid 2.2.1 TiSDK 1.6.1</p>
      <h5>Does Not display textArea until after orientation change</h5>
      <p>Emulator APIs 1.6 Screen QVGA TiSDK 1.6.1<br>
      Emulator APIs 1.6 Screen HVGA TiSDK 1.6.1<br>
      G1 1.6 TiSDK 1.6.1</p></div>{html}

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                billdawson Bill Dawson
                Reporter:
                jalter Jon Alter
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-3036
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration