gpt4 book ai didi

swift - 单击设置为隐藏在 xcode 中的按钮会在隐藏之前在模拟器中留下一条细线

转载 作者:行者123 更新时间:2023-11-28 05:50:36 26 4
gpt4 key购买 nike

我是 swift 的新手,所以有点费力想弄清楚发生了什么。这是我的代码片段。我还附上了图片,显示了单击按钮后的外观。任何帮助将不胜感激。谢谢。

@IBOutlet weak var btnOptionOne: UIButton!
@IBOutlet weak var btnOptionTwo: UIButton!
@IBOutlet weak var btnOptionThree: UIButton!

override func viewDidLoad() {
super.viewDidLoad()
backgroundColor = view.backgroundColor
// Do any additional setup after loading the view, typically from a nib.
card.layer.cornerRadius = 20.0
frontLabel.layer.cornerRadius = 20.0
backLabel.layer.cornerRadius = 20.0

btnOptionOne.layer.cornerRadius = 20.0
btnOptionOne.layer.borderColor = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)
btnOptionOne.layer.borderWidth = 3.0

btnOptionTwo.layer.cornerRadius = 20.0
btnOptionTwo.layer.borderColor = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)
btnOptionTwo.layer.borderWidth = 3.0

btnOptionThree.layer.cornerRadius = 20.0
btnOptionThree.layer.borderColor = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)
btnOptionThree.layer.borderWidth = 3.0

card.layer.shadowRadius = 15.0
frontLabel.layer.shadowRadius = 15.0
backLabel.layer.shadowRadius = 15.0

card.layer.shadowOpacity = 0.2
frontLabel.layer.shadowOpacity = 0.2
backLabel.layer.shadowOpacity = 0.2

frontLabel.clipsToBounds = true
backLabel.clipsToBounds = true
}


@IBAction func didTapOnFlashcard(_ sender: Any) {
if frontLabel.isHidden == true{
frontLabel.isHidden = false;
}
else{
frontLabel.isHidden = true;
}
}

@IBAction func didTapOptionOne(_ sender: Any) {
btnOptionOne.isHidden = true
}

Before clicking on the first option

After clicking on the first option

最佳答案

同时点击移除阴影:-

btnOptionOne.layer.shadowOpacity = 0
btnOptionOne.layer.shadowRadius = 0
btnOptionOne.layer.shadowColor = nil

关于swift - 单击设置为隐藏在 xcode 中的按钮会在隐藏之前在模拟器中留下一条细线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53128933/

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