[TIMOB-23140] Android: Add lineSpacing property to Label
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-04-06T11:41:16.000+0000 |
Affected Version/s | Release 5.2.1 |
Fix Version/s | Release 5.4.0 |
Components | Android |
Labels | android, label |
Reporter | Michael Gangolf |
Assignee | Ashraf Abu |
Created | 2016-04-02T15:52:00.000+0000 |
Updated | 2016-05-27T21:02:02.000+0000 |
Description
Add
{noformat}
lineSpacing: {add: float, multiply: float}
{noformat}
to Label
!http://migaweb.de/linespacing.png!
Android doc: http://developer.android.com/reference/android/widget/TextView.html#setLineSpacing%28float,%20float%29
*Example:*
var win = $.UI.create("Window", {
layout: "vertical",
backgroundColor: "#fff"
});
var l = $.UI.create("Label", {
lineSpacing: {
add: 20,
multiply: 1
},
text: "asdfasdfasdf\nasfasfasfasfafsd\nasfasfasdfasdf\nadsfasdfasdf",
height: Ti.UI.SIZE,
width: Ti.UI.SIZE,
backgroundColor:"red"
});
var l2 = $.UI.create("Label", {
lineSpacing: {
add: 0,
multiply: 1
},
text: "qwerqwerqwer\nqwerqwer\nqwerqwerqwe\nqwerqwerqwre",
height: Ti.UI.SIZE,
width: Ti.UI.SIZE,
backgroundColor:"green"
});
var l3 = $.UI.create("Label", {
lineSpacing: {
add: 10,
multiply: 0
},
text: "yxcvyxcyvx\nycxvyxcvyxc\nyxvcyxcvyxcv\nyxcvyxvyxc\nyxcvyxcvyx",
height: Ti.UI.SIZE,
width: Ti.UI.SIZE,
backgroundColor:"yellow"
});
win.add(l);
win.add(l2);
win.add(l3);
win.open();
PR: https://github.com/appcelerator/titanium_mobile/pull/7909
getter/setter:
Thank you for the PR.
Verified the implementation & it works as expected. Closing. Environment: Appc Studio : 4.6.0.201605180604 Ti SDK : 5.4.0.v20160526011354 Ti CLI : 5.0.8 Alloy : 1.8.7 MAC El Capitan : 10.11.4 Appc NPM : 4.2.5-5 Appc CLI : 5.3.0-47 Node: 4.2.2 Nexus 6 - Android 6.0.0