Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1856] Android: Scrollview does not allow child view to use right:0 to specify full width

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:57:21.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsAndroid
Labelsandroid, defect
ReporterBill Dawson
AssigneeDon Thorp
Created2011-04-15T03:04:03.000+0000
Updated2011-04-17T01:57:21.000+0000

Description

Sample app.js:

Titanium.UI.setBackgroundColor('#000');
var win = Ti.UI.createWindow({
    exitOnClose: true,
    fullscreen: true,
    backgroundColor: 'purple'
});
var sv = Ti.UI.createScrollView({
    left: 0, right: 0, top: 0, height: 100,
    backgroundColor: 'green'
});
var v = Ti.UI.createView({
    left: 0, right: 0, top: 0, height: 50,
    backgroundColor: 'red'
});
sv.add(v);
win.add(sv);
win.open();

You should see a smaller red view inside the green scrollview. But you don't. If you change createView argument right:0 to width:100 it works.

Note that if the outer view is a standard View instead of a ScrollView, it works fine. So it seems to be only happening with ScrollView.

Comments

  1. Bill Dawson 2011-04-15

    Assigned to Don for milestone/priority.

  2. Don Thorp 2011-04-15

    What's the expected setting of contentWidth in order to give you width of the ScrollView's content area?

  3. Don Thorp 2011-04-15

    (from [fae3442e85164bc616e31441fa5de28fb18e41fa]) [#987 state:fixed-in-qa][#1472 state:fixed-in-qa][#1856 state:fixed-in-qa][#863 state:fixed-in-qa] scroll view support vertical layout. Fixed other layout issues with scrollview. Note: #863 the KS test seems to have been changed to include top. I removed top and the label display as expected. http://github.com/appcelerator/titanium_mobile/commit/fae3442e85164bc616e31441fa5de28fb18e41fa"> http://github.com/appcelerator/titanium_mobile/commit/fae3442e85164...

  4. Thomas Huelbert 2011-04-15

    1.4.2.4ce7ff G1 running 1.6, 2.2 simulator.

JSON Source