Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不同CTRun的下滑线对齐 #21

Open
AndyLxl opened this issue Jan 28, 2021 · 6 comments
Open

不同CTRun的下滑线对齐 #21

AndyLxl opened this issue Jan 28, 2021 · 6 comments

Comments

@AndyLxl
Copy link

AndyLxl commented Jan 28, 2021

一个CTLine里面,不同CTRun,它们的下划线没有处在同一水平线上,如何调整

@lele8446
Copy link
Owner

lele8446 commented Feb 2, 2021

一个CTLine里面,不同CTRun,它们的下划线没有处在同一水平线上,如何调整

如果是label整体文本的垂直对齐,使用label.verticalAlignment属性;如果是针对图文混排的指定行的对齐,可以使用+initWithView:viewSize:lineAlignment:configure:或+insertViewAtAttrString:view:viewSize:atIndex:lineAlignment:configure:方法设置;当然也可以只插入一个0.1像素的空白view,同时设置lineAlignment属性,从与达到对齐效果

@AndyLxl
Copy link
Author

AndyLxl commented Feb 2, 2021 via email

@lele8446
Copy link
Owner

lele8446 commented Feb 2, 2021 via email

@AndyLxl
Copy link
Author

AndyLxl commented Feb 2, 2021 via email

@lele8446
Copy link
Owner

lele8446 commented Feb 2, 2021 via email

@AndyLxl
Copy link
Author

AndyLxl commented Mar 15, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants