add text lineSpacing
This commit is contained in:
parent
e46f09427b
commit
90e494222d
@ -1,4 +1,4 @@
|
||||
import { Panel, Group, scroller, vlayout, layoutConfig, LayoutSpec, Input, Gravity, log, input, text, Color } from "doric";
|
||||
import { Panel, Group, scroller, vlayout, layoutConfig, LayoutSpec, Input, Gravity, log, input, text, Color, Text } from "doric";
|
||||
import { title } from "./utils";
|
||||
@Entry
|
||||
class TextDemo extends Panel {
|
||||
@ -64,6 +64,10 @@ class TextDemo extends Panel {
|
||||
lineSpacing: 40,
|
||||
textColor: Color.RED,
|
||||
textAlignment: Gravity.Right,
|
||||
onClick: function () {
|
||||
(this as Text).textAlignment = Gravity.Left;
|
||||
(this as Text).textColor = Color.BLACK;
|
||||
}
|
||||
}),
|
||||
],
|
||||
{
|
||||
|
@ -88,6 +88,9 @@ - (void)blendView:(UILabel *)view forPropName:(NSString *)name propValue:(id)pro
|
||||
}
|
||||
if (self.paragraphStyle) {
|
||||
self.paragraphStyle.alignment = alignment;
|
||||
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:view.text];
|
||||
[attributedString addAttribute:NSParagraphStyleAttributeName value:self.paragraphStyle range:NSMakeRange(0, [attributedString length])];
|
||||
view.attributedText = attributedString;
|
||||
} else {
|
||||
view.textAlignment = alignment;
|
||||
}
|
||||
|
@ -1823,12 +1823,9 @@ var List = /** @class */ (function (_super) {
|
||||
this.itemCount = 0;
|
||||
};
|
||||
List.prototype.getItem = function (itemIdx) {
|
||||
var view = this.cachedViews.get("" + itemIdx);
|
||||
if (view === undefined) {
|
||||
view = this.renderItem(itemIdx);
|
||||
var view = this.renderItem(itemIdx);
|
||||
view.superview = this;
|
||||
this.cachedViews.set("" + itemIdx, view);
|
||||
}
|
||||
return view;
|
||||
};
|
||||
List.prototype.isDirty = function () {
|
||||
|
@ -1345,12 +1345,9 @@ class List extends Superview {
|
||||
this.itemCount = 0;
|
||||
}
|
||||
getItem(itemIdx) {
|
||||
let view = this.cachedViews.get(`${itemIdx}`);
|
||||
if (view === undefined) {
|
||||
view = this.renderItem(itemIdx);
|
||||
let view = this.renderItem(itemIdx);
|
||||
view.superview = this;
|
||||
this.cachedViews.set(`${itemIdx}`, view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
isDirty() {
|
||||
|
@ -2804,12 +2804,9 @@ class List extends Superview {
|
||||
this.itemCount = 0;
|
||||
}
|
||||
getItem(itemIdx) {
|
||||
let view = this.cachedViews.get(`${itemIdx}`);
|
||||
if (view === undefined) {
|
||||
view = this.renderItem(itemIdx);
|
||||
let view = this.renderItem(itemIdx);
|
||||
view.superview = this;
|
||||
this.cachedViews.set(`${itemIdx}`, view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
isDirty() {
|
||||
|
@ -52,12 +52,9 @@ export class List extends Superview {
|
||||
this.itemCount = 0;
|
||||
}
|
||||
getItem(itemIdx) {
|
||||
let view = this.cachedViews.get(`${itemIdx}`);
|
||||
if (view === undefined) {
|
||||
view = this.renderItem(itemIdx);
|
||||
let view = this.renderItem(itemIdx);
|
||||
view.superview = this;
|
||||
this.cachedViews.set(`${itemIdx}`, view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
isDirty() {
|
||||
|
5
doric-web/dist/index.js
vendored
5
doric-web/dist/index.js
vendored
@ -2862,12 +2862,9 @@ class List extends Superview {
|
||||
this.itemCount = 0;
|
||||
}
|
||||
getItem(itemIdx) {
|
||||
let view = this.cachedViews.get(`${itemIdx}`);
|
||||
if (view === undefined) {
|
||||
view = this.renderItem(itemIdx);
|
||||
let view = this.renderItem(itemIdx);
|
||||
view.superview = this;
|
||||
this.cachedViews.set(`${itemIdx}`, view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
isDirty() {
|
||||
|
2
doric-web/dist/index.js.map
vendored
2
doric-web/dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user