Cellular accessory keeps truncating UILabel

I'm just wondering why the UILabel in UICell gets truncated, even though it will actually be there.

enter image description here

I know the helper indicator takes up some space, but that's not the main thing, from what I see in my storyboard, uilabel will fit easily into it. My limitations are not very harsh - no trailing space set, only leading space and vertical alignment.

enter image description here

Do you have any idea what might be causing the UILabel to be truncated? I mean, I know the truncation is caused by the Line Breaks parameter, but that's not the point, what is wrong with this free space next to the label, what is causing it to break?

Thank you in advance

EDIT:

this is the code snippet where i am setting the color, maybe it is something with this frame to achieve a gradient color?

cell!.cellWorkoutLabel.text = workout.title
    cell!.cellWorkoutLabel.sizeToFit()
    var frameCell = CGRectMake(0,0, 500, 500)
    if(indexPath.row%2==0){
        cell!.backgroundColor = GradientColor(UIGradientStyle.Radial, frameCell, colors)
    }
    else if(indexPath.row%2 != 0)
    {
       cell!.backgroundColor = GradientColor(UIGradientStyle.Radial, frameCell, colors)
    }

      

+3


source to share


1 answer


You need to set trailing space on the label because bydefault takes up the width, so it happens. Therefore, you need to install it manually.



+2


source







All Articles