[TIMOB-24236] Support language natural direction text alignment
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2016-12-17T17:11:27.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | RTL |
Reporter | Hazem Khaled |
Assignee | Eric Merriman |
Created | 2016-12-16T16:57:21.000+0000 |
Updated | 2017-03-24T18:03:20.000+0000 |
Description
We want to add new natural text alignment, already supported both iOS and Android, for Android natural is anyRtl.
iOS
https://developer.apple.com/reference/uikit/uilabel/1620541-textalignment
Android
https://developer.android.com/reference/android/view/View.html#attr_android:textDirection
var win = Ti.UI.createWindow({
layout: 'vertical'
}),
rtlLabel = Ti.UI.createLabel({
text: "أنقذوا حلب، أنقذوا سوريا!!",
top: 30,
textAlign: Ti.UI.TEXT_ALIGNMENT_NATURAL
}),
ltrLabel = Ti.UI.createLabel({
text: "Save Aleppo, Save Syria!!",
top: 30,
textAlign: Ti.UI.TEXT_ALIGNMENT_NATURAL
});
win.add(rtlLabel);
win.add(ltrLabel);
win.open();
Hey [~hazemkhaled], we recently changed the iOS text-alignment to be natural by default (see [this snippet](https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUtils.m#L1354) from 6.1.0 / master), which still behaves as left-aligned text for your example. For advanced RTL-styles, use the [Ti.UI.ATTRIBUTE_WRITING_DIRECTION_RIGHT_TO_LEFT](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI-property-ATTRIBUTE_WRITING_DIRECTION_RIGHT_TO_LEFT) attribute for attributed labels.
Closing ticket as invalid with reference to the above comments.