gpt4 book ai didi

ios - 如何以编程方式在 imageView 底部添加标签?

转载 作者:可可西里 更新时间:2023-11-01 01:23:41 26 4
gpt4 key购买 nike

我试图在 imageView 的底部添加一个标签作为 subview ,但是当图像改变其高度或宽度时,标签没有响应。所以我想做一个动态标签。

This is what i did until now

最佳答案

加个赞

 var lbl1 =  UILabel(frame: CGRect(x: yourimageview.frame.origin.x, y: yourimageview.frame.origin.y + yourimageview.frame.size.height + 5, width: yourimageview.frame.size.width, height: asyourWish))


lbl1.textColor = UIColor.black
lbl1.frame = position
lbl1.backgroundColor = UIColor.clear
lbl1.textColor = UIColor.white

lbl1.text = "TEST"
self.view.addSubview(lbl1)

关于ios - 如何以编程方式在 imageView 底部添加标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42414854/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com