Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
garispe opened this issue Mar 29, 2017 · 1 comment
Open

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

garispe opened this issue Mar 29, 2017 · 1 comment

Comments

@garispe
Copy link

garispe commented Mar 29, 2017

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 garispe changed the title UILabel doesn't show UILabel is not displayed when it is added to the page. Mar 29, 2017
@markdavo
Copy link

markdavo commented Feb 2, 2018

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants