gpt4 book ai didi

ios - CALayer 不显示 iOS8

转载 作者:行者123 更新时间:2023-11-28 12:16:17 25 4
gpt4 key购买 nike

在我的应用程序的联系表单中,文本输入字段的框底部有一条白线。

let border = CALayer()
border.frame = CGRect(x: 0, y: textInput.frame.height, width: textInput.frame.width, height: 3)
border.borderColor = UIColor.white.cgColor
border.borderWidth = 3
textInput.layer.addSublayer(border)

所需的边框在 iOS10 上显示正常,但在 iOS8 上测试时却不显示。

iOS 8 是否有一些我不知道的利基市场?

最佳答案

您的 Y 点是文本输入的高度,使其为 0 或小于高度的值

let border = CALayer()

border.frame = CGRect(x: 0, y: textInput.frame.height - 3, width: textInput.frame.width, height: 3)

border.borderColor = UIColor.white.cgColor

border.borderWidth = 3

textInput.layer.addSublayer(border)

关于ios - CALayer 不显示 iOS8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46465678/

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