Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16645] Android 4.4.X - sizing with percentages creates unexpected results

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterBert Grantges
AssigneeUnknown
Created2014-03-19T11:26:16.000+0000
Updated2018-02-28T20:04:01.000+0000

Description

NOTE: This only happens on Android 4.4+, older versions of Android are behaving correctly. When trying to align certain elements on a screen using percentages, the relative widths calculated are going above 100% within the parent view, causing wrapping or clipping within the view. This is happening when you have a parent view of say 90% width and then two child views that both have 50% width.

Expected result:

The child views should be 1/2 the size of the parent view's width and should render as expected, with both side by side.

Actual result:

The child views are being wrapped or clipped creating an undesired look and feel.

Workaround:

Setting one or both of the elements to a width of "49.9%" fixes the issue. SAMPLE CODE HERE: https://gist.github.com/grantges/6747ed1d3513f0d45eb2

Comments

No comments

JSON Source