chenjun

去除title中的换行符,第四行适配使得箭头在第四行

... ... @@ -71,7 +71,7 @@ export struct PlayerTitleView {
* @returns {string} clipStr 截断后的文本 '啊啊'
*/
clipText(str: string, fontSize: number, maxLines: number, textWidth: number): string {
let strArr: string[] = str.split("")
let strArr: string[] = str.replace('\n', '').split("")
let truncateContent: string = '啊啊啊啊啊啊' // ...比正常文字宽度更小,这里使用啊啊啊(任意三个文字)代替计算
let measureTruncateWidth: number = measure.measureText({
textContent: truncateContent,
... ... @@ -219,7 +219,7 @@ export struct PlayerTitleView {
// } else {
if (this.summary && this.titleLines < 4) {
Text() {
Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50)))
Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 160 - vp2px(50)))
.fontSize(14)
.fontColor(Color.White)
.lineHeight(21)
... ...