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

DTCoreText can't draw underline in iOS18. #1280

Open
ximmyxiao opened this issue Jul 19, 2024 · 7 comments
Open

DTCoreText can't draw underline in iOS18. #1280

ximmyxiao opened this issue Jul 19, 2024 · 7 comments

Comments

@ximmyxiao
Copy link
Contributor

ximmyxiao commented Jul 19, 2024

I have wrote a demo like this

- (NSAttributedString*)testContent
{
	NSString* content = @"111";

	NSMutableAttributedString* attri = [[NSMutableAttributedString alloc] initWithString:content];
	[attri addAttributes:@{NSUnderlineStyleAttributeName:@(1),NSUnderlineColorAttributeName:[UIColor redColor],NSForegroundColorAttributeName:[UIColor greenColor]} range:NSMakeRange(0, [content length]) ];

	return [attri copy];
}

and set this content to DTAttributedTextContentView,
the underline will not show in iOS18 beta3 and the newest beta version of Xcode , but it works well in iOS17 and before. seems the CoreText is changed something in underline drawing in iOS18.

more exactly reason can be seem:
here

@daiyangyang945
Copy link

Hello, I have the same issue as you, did you solve it

@nicolasmuller
Copy link

+1

1 similar comment
@ZHK1024
Copy link

ZHK1024 commented Oct 20, 2024

+1

@ximmyxiao
Copy link
Contributor Author

@daiyangyang945 @nicolasmuller I found this problem only exist in some beta version of iOS , you guys can check it in the public version of iOS 18.x

@daiyangyang945
Copy link

@daiyangyang945 @nicolasmuller I found this problem only exist in some beta version of iOS , you guys can check it in the public version of iOS 18.x

Okay, thank you for your reply

@benjaminbarbe
Copy link

@ximmyxiao @daiyangyang945 @nicolasmuller
It's the same issue with the public version 18.1 😔

@ximmyxiao
Copy link
Contributor Author

@benjaminbarbe , in my iPhone16 pro with iOS18.1 , the underline can be drawn well , But in my iPhone15 pro max with iPhone 18.2 beta and in any simulator with iOS 18 , the underline can't be drawn

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

5 participants