PDFGenerator icon indicating copy to clipboard operation
PDFGenerator copied to clipboard

UILabel is not displayed when it is added to the page.

Open garispe opened this issue 7 years ago • 1 comments

UILabel is not displayed when it is added to the page.

let page1 = UIView(frame: CGRect(x: 0, y: 0, width: 595.0, height: 842.0)) page1.backgroundColor = .white

let label = UILabel.init(frame: CGRect(x: 0, y: 0, width: 595.0, height: 25)) label.textAlignment = .center label.textColor = UIColor.black label.font = UIFont.systemFont(ofSize: 13, weight: UIFontWeightMedium)

page1.addSubview(label)

garispe avatar Mar 29 '17 19:03 garispe

Hi Garispe - The following code works for me let v1 = UIView(frame: CGRect(x: 0.0,y: 0, width: 1240, height: 1754)) v1.backgroundColor = .white let title = UILabel(frame: CGRect(x: 0.0,y: 0, width: 1240.0, height: 50.0)) title.text = "Professional Development Report" title.font = UIFont(name:"Avenir", size: 30.0) title.textAlignment = .center v1.addSubview(title)

markdavo avatar Feb 02 '18 07:02 markdavo