Closed ankitagarwal007 closed 3 years ago
Hi @ankitagarwal007, thanks for opening this issue. I can't reproduce it 🤔 I realized that you're using version 1.8.2 and the latest version is 1.21.2. Please, could you update the dependency? I think this issue is already solved :)
@Juanpe I have mentioned the wrong version. I am using the latest version 1.21.2. I dug a Lil deeper and I found that if I use a color from color. xcassets it is replicating and if I use any color directly than it is showing fine but with a fixed height of SkeletonViewAppearance.multilineHeight
I have tried it on 12.2 iPhone X, and I have also raised a PR for the fix. If you see the PR we haven't consider font line height anywhere like we have done it for UITextView.
It's so weird 🤔 could you provide me a simple project?
SkeletonDemo.zip @Juanpe Attached a simple project
Thanks for the project. It's mind-blowing 🤯 I'm checking but as you said, the problem is if the label text color is defined in a xcasset, the frame is different
I was investigating and the problem is in iOS 12, when you use a color asset, the color is set when the view is displayed, so this method override the color assigned by the library. I'm checking if the method layoutSubviews
could be useful to replace this color :/
Solved by #427
Description
The UIlabel takes the line-height of either the height constraint or the line SkeletonViewAppearance.multilineHeight It doesn't consider the font line height as considered in UITextView. This is causing issues in the ios 12 version as the text behind the skeleton is visible. Also on versions >=13.0 the font line height is not considered so all the labels are of the same height
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
SkeletonView Environment:
SkeletonView version: 1.21.2 Xcode version: 12.5.1 Swift version: 5.1
Steps to reproduce:
Expected result:
Skeleton View should be according to the line height of the font. Code should be similar to UITextview+Multiline.swift line-height property
Actual result:
iOS 12.0 : The text behind is showing iOS >=13.0 : UIlabel skeleton height is equal to SkeletonViewAppearance.multilineHeight
Attachments:
iOS 12.0
iOS >=13.0
Expected on all iOS Versions