Juanpe / SkeletonView

☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
MIT License
12.51k stars 1.1k forks source link

Vertically center alignment for UILabel's text. #453

Closed taejun-kurly closed 2 years ago

taejun-kurly commented 2 years ago

Description

Basically, UILabel's text is vertically center aligned (unlike UITextView). Even if it's multi line or not. However, Skeleton layer in UILabel is always top aligned.

Therefore I propose to change Skeleton layer in UILabel to be vertically center aligned. I think it would be more natural than now.

Thanks.

Screenshots

Juanpe commented 2 years ago

Hi @taejun-kurly, good point! I'll add it to the backlog 👍🏼

selanthiraiyan commented 2 years ago

Hello @taejun-kurly, This is a great point and thanks for raising an issue. Could you kindly let me know the steps to make the View (UILabel in this case) and SkeletonView layer visible at the same time? Just like this screenshot from your comment above. Thanks!

@Juanpe More context: I am trying to work in this issue, by altering func updateMultilinesLayers(for config: SkeletonMultilinesLayerConfig) from CALayer+Extensions.swift file. It will be helpful to have the View and the Skeleton layers visible at the same time, to check the alignment. For now, I am using another UILabel in the background with equal width and height constraints, but it isn't working well.