Skip to content

Incompatibility in view alignment between iOS and Android when width is undefined #14447

Description

@grebulon

I have searched and made sure there are no existing issues for the issue I am filing

  • I have searched the existing issues

Description

When adding a view where only right positioning is provided WITHOUT width, like:

var label = Ti.UI.createLabel({text:"Hello World", right:10, color:"#000000"});
parentView.add(label);

results in different behavior between platforms.

Adding a width property like the following fixed the issue:

var label = Ti.UI.createLabel({text:"Hello World", right:10, width:Ti.UI.SIZE, color:"#000000"});

Expected Behavior

The label should be positioned to the right of the parent view on both iOS and Android.

Actual behavior

On iOS: the label will be positioned to the right of the parent view as expected.
On Android: the label will be positioned to the LEFT as if the [missing] width is filling the entire space.

Reproducible sample

see above

Steps to reproduce

see above

Platform

Android, Android & iOS

SDK version you are using

13.3.0

Alloy version you are using

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds triageThis issue hasn't been reviewed by maintainers

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions