-2

How can I add a background frame color programmatically to a label? I don't mean shadow.

It should look like this in the end.

Right now I use this but it is not good.


   var textView : UILabel
                textView  = UILabel(frame:CGRect(x:30, y:7, width:120, height:10));
                // textView.backgroundColor = .white
                textView.text = marker1.title
                textView.textColor = .black
                textView.shadowColor = .white
                textView.font = backView.font.withSize(8)
                textView.layer.masksToBounds = true
                textView.layer.shadowRadius = 2.0
                textView.layer.shadowOpacity = 0.2
                textView.layer.shadowOffset = CGSize(width: 1, height: 2)

submariner
  • 496
  • 1
  • 2
  • 18

0 Answers0