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:55:33 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c737a51e7a3dc22902bdd3848a5c87264e5995aa
c737a51e
1 parent
c3860d3e
去除title中的所有换行符
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
1 deletions
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
View file @
c737a51
...
...
@@ -71,7 +71,7 @@ export struct PlayerTitleView {
* @returns {string} clipStr 截断后的文本 '啊啊'
*/
clipText(str: string, fontSize: number, maxLines: number, textWidth: number): string {
let strArr: string[] = str.replace(
'\n'
, '').split("")
let strArr: string[] = str.replace(
/\n/g
, '').split("")
let truncateContent: string = '啊啊啊啊啊啊' // ...比正常文字宽度更小,这里使用啊啊啊(任意三个文字)代替计算
let measureTruncateWidth: number = measure.measureText({
textContent: truncateContent,
...
...
Please
register
or
login
to post a comment