Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9069] Android: View inside ScrollView doesn't scroll up if its height is defined as percentage

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-06-02T15:22:51.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sn/a
ComponentsAndroid
Labelsapi, exalture
ReporterIvan Skugor
AssigneeSunila
Created2012-05-03T07:34:38.000+0000
Updated2017-03-21T21:31:06.000+0000

Description

Problem

To see the issue, run this example:
var win = Ti.UI.createWindow({ backgroundColor: '#000', modal: true, navBarHidden: true });
var view = Ti.UI.createScrollView({ backgroundColor: '#f00' });

var textField = Ti.UI.createTextField({ width: 200, height: 75 });

view.add(textField);

var toolbar = Ti.UI.createView({
    backgroundColor: '#00f',
    height: '15%',
    //height: 100, //works with this value
    bottom: 0,
    layout: 'horizontal'
});

var saveButton = Ti.UI.createButton({
    backgroundColor: '#444',
    left: 20,
    width: 150,
    height: 60,
    title: 'Save',
    color: '#ccc'
});

toolbar.add(saveButton);
view.add(toolbar);
win.add(view);
win.open();
Text field should automatically receive focus and button should be seen on the screen. The problem is that "toolbar" view did not scroll up and it is not visible on the screen. If keyboard is lowered, "toolbar" view is visible on the bottom of the screen. If text field is again focused (by clicking on it), same issue can be seen.

Expected behavior

"toolbar" should be scrolled up. This issue does not exist if "height" property is defined as numeric value.

Attachments

FileDateSize
After down keyboard.png2013-03-01T13:32:43.000+000011955
height_numeric.png2013-03-01T13:32:43.000+000041488
height_percentage.png2013-03-01T13:32:43.000+000042449

Comments

  1. Shameer Jan 2013-03-01

    I did not get the actual problem. Can you attach screen shots of actual problem? I tested on Titanium Studio, build: 2.1.2.201208301612 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 Device: Samsung galaxy s duos Android version: 4.0.4 when focus the textfeild, "toolbar" view becomes visible top of soft keyboard.If keyboard is lowered, "toolbar" view is visible on the bottom of the screen. If "height" property defined as percentage, "toolbar" view's size get reduced ,but when it defined as numeric value problem won't exist.Here is my observation (Check screen shot ). attachments 1.after down keyboard 2."height" defined as numeric 3."height" defined as percentage
  2. Ivan Skugor 2013-03-02

    Seems like original problem is fixed. Thanks :)
  3. Sunila 2013-06-02

    Tried with 3.2.0, toolbar is scrolled to view when soft keyboard is shown.
  4. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced.

JSON Source