Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
chenjun
2024-09-05 14:45:38 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c3860d3edc8c9fe826431a2146e70dceaebf1b21
c3860d3e
1 parent
aa91affa
去除title中的换行符,第四行适配使得箭头在第四行
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
View file @
c3860d3
...
...
@@ -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 - 1
5
0 - vp2px(50)))
Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 1
6
0 - vp2px(50)))
.fontSize(14)
.fontColor(Color.White)
.lineHeight(21)
...
...
Please
register
or
login
to post a comment