티스토리 뷰
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | func createButton () { let button = UIButton(); button.setTitle("Back", forState: .Normal) button.setTitleColor(UIColor.blueColor(), forState: .Normal) button.frame = CGRectMake(25, 25, 35, 30) // X, Y, width, height button.addTarget(self, action: "buttonPressed:", forControlEvents: .TouchUpInside) button.backgroundColor = UIColor(red: (31/255.0), green: (146/255.0), blue: (160/255.0), alpha: 1.0) button.layer.cornerRadius = 5 button.layer.masksToBounds = true self.view.addSubview(button) } func createImageButton () { let button = UIButton(); button.setImage(UIImage(named: "ic_back_24px"), forState: .Normal) button.frame = CGRectMake(25, 25, 35, 30) // X, Y, width, height button.addTarget(self, action: "buttonPressed:", forControlEvents: .TouchUpInside) button.backgroundColor = UIColor(red: (31/255.0), green: (146/255.0), blue: (160/255.0), alpha: 1.0) button.layer.cornerRadius = 5 button.layer.masksToBounds = true self.view.addSubview(button) } | cs |
'IOS - SWIFT' 카테고리의 다른 글
IOS SWIFT 메일 보내기 swift send mail (MFMailComposeViewController) (0) | 2016.01.27 |
---|---|
IOS SWIFT 웹 링크 사파리 swift URL link (UIApplication.sharedApplication().openURL) (0) | 2016.01.27 |
IOS SWIFT 키보드 높이 구하기 swift keyboard height (UIKeyboardWillShowNotification) (1) | 2016.01.27 |
IOS SWIFT 타이머 설정하기 (NSTimer) (0) | 2016.01.27 |
IOS SWIFT 문자열 나누기 (componentsSeparatedByString) (0) | 2016.01.27 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday