Closed lopesmcc closed 2 years ago
Hi @lopesmcc 👋🏼
TBH, I didn't consider this scenario until now, but I agree with you and I can find no good reasons to do that 🤔 The only important thing would be to update the README file indicating that lastLineFillPercent
will be applied to the one-line labels as well.
Would you like to contribute? 🙂
@Juanpe
Hello, Hope you are doing well.
I have created a PR to add the change that was suggested by @lopesmcc. I have tested this by altering the labels and textviews in the iOS Example
's Main.storyboard
file. As far as I understood the code, this change doesn't break anything else. Kindly let me know your thoughts.
Thank you!
lastLineFillPercent
by design is limited to multiline text views. It's mostly due to the following lines within thecalculatedWidthForLine
function:I believe removing the
totalLines != 1
would be enough to enable fill percent for one-line text views, but am unsure of side-effects as I haven't tested it.I was curious however as to why limit the skeleton view to not allow changing the skeleton fill-percent on one-line text views. Is there a reason for this?
It would be useful as some skeleton designs don't fill the whole width of the view. To go around this, I've been using
skeletonPaddingInsets
, but IMO it would be a lot cleaner and precise using thelastLineFillPercent
attribute instead.