UIButton of type UIButtonTypeCustom will not display Title (iPhone)

后端 未结 5 1698
栀梦
栀梦 2020-12-08 09:21

I must have overlooked something completely obvious?? but my button displays its image and size correctly, but I simply can\'t get the Title to show up.

I did a real

5条回答
  •  无人及你
    2020-12-08 10:06

    I found the problem!

    It's not Image overriding the title. It is being push off frame by the image.

    Try use this:

    [btn setTitleEdgeInsets:UIEdgeInsetsMake(0.0, -img.size.width, 0.0, 0.0 )];

    Hope it helps!

提交回复
热议问题