我要求设置图像中88:88存在的时间。欢迎任何建议。
发布于 2018-10-03 11:58:23
您需要在UIImageView
中显示图像(没有文本),并添加一个UILabel
作为子视图。
let image = UIImageView()
image.frame = CGRect(x: 0, y: 0, width: 50, height: 50)
let label = UILabel()
label.text = "88:88"
image.addSubview(label)
label.frame = image.frame
label.textAlignment = .center
注意:使用与图像视图相同的帧设置标签,并将文本对齐设置为中心,确保标签在图像内(垂直和水平)居中。
https://stackoverflow.com/questions/52623256
复制相似问题