TextView Line Corner Radius Issue

4
closed
efalloon
efalloon
Posted 4 months ago

TextView Line Corner Radius Issue #474

I cannot set a line corner radius on a textview using the .linesCornerRadius function programatically. However, when I apply the said corner radius on storyboards, it works.

JacksonJang
JacksonJang
Created 4 months ago

I solved issue

link : https://github.com/Juanpe/SkeletonView/pull/475

have a good day^^

Juanpe
Juanpe
Created 4 months ago

Hi @efalloon 👋🏼

I've checked this issue and I can't reproduce this issue. I mean, in the example project, if I set programmatically the corner radius, it works.

efalloon
efalloon
Created 4 months ago

descriptionTextView.isSkeletonable = true descriptionTextView.showSkeleton(usingColor: .tertiarySystemFill, transition: .crossDissolve(1)) descriptionTextView.skeletonCornerRadius = 5 descriptionTextView.lastLineFillPercent = Int.random(in: 30..<75) descriptionTextView.skeletonLineSpacing = 12.5 descriptionTextView.isScrollEnabled = false This is what my code currently looks like. Everything works except for the corner radius.

Juanpe
Juanpe
Created 4 months ago

Ok, the problem is that you are not using the right property. You have to use linesCornerRadius. And you have to set all the properties before show the skeleton as well.

Your code would look like this:

descriptionTextView.isSkeletonable = true 
descriptionTextView.linesCornerRadius = 5 
descriptionTextView.lastLineFillPercent = Int.random(in: 30..<75) 
descriptionTextView.skeletonLineSpacing = 12.5 
descriptionTextView.isScrollEnabled = false

descriptionTextView.showSkeleton(usingColor: .tertiarySystemFill, transition: .crossDissolve(1))

BTW, I think I should clarify this in the README file because it looks confusing

@efalloon, could you check it to close this issue, please? Thanks 👍🏼