새소식

인기 검색어

iOS/iOS

[iOS] UIButton

  • -
var button: UIButton = UIButton()

// 버튼의 타이틀 변경
button.setTitle("my text here", forState: .nomal)

// 버튼의 타이틀 색상 변경
button.setTitleColor(color: UIColor?, for: UIControl.State)

// 버튼의 타이틀 폰트
button.titleLabel?.font = UIFont

// 버튼 동작 여부
button.isEnabled = Bool

// 버튼의 백그라운드 색상 변경
button.backgroundColor = UIColor

// 버튼의 이미지 설정
button.setImage(image: UIImage?, for: UIContorl.State)

// 버튼의 코너 설정
button.layer.cornerRadius = CGFloat
button.clipsToBounds = true

// 버튼의 border설정
button.layer.borderWidth = CGFloat
button.layer.borderColor = CGColor

'iOS > iOS' 카테고리의 다른 글

[iOS] Xcode Stroyboard 없이 시작하기  (0) 2023.02.02
[iOS] UIStackView  (0) 2023.01.23
[iOS] UITextField  (0) 2023.01.23
[iOS] TableView  (0) 2022.09.20
[iOS] 키보드 자동으로 내리기 및 키보드 위치에 따라 TextField 위치 바꾸기  (0) 2022.06.04
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.