storyboard를 사용하여 버튼을 생성시 혹은 동적으로 버튼을 생성시 테두리 border가 들어가지 않는데
이때 아래의 코드를 사용하여 버튼에 테두리를 넣을 수 있다.
addClothesButton.layer.borderColor = UIColor.white.cgColor
addClothesButton.layer.borderWidth = 2
주의할점은 borderWidth 값을 주지 않으면 borderColor를 넣어도 테두리가 보이지 않는다.
addClothesButton.layer.cornerRadius = 10
위의 코드로는 버튼의 모서리 부분을 둥글게 처리 할 수 있다.
'programming language > swift' 카테고리의 다른 글
ios 동적버튼을 사용한 화면 전환 in swift (0) | 2016.11.28 |
---|---|
ios status bar style 설정하기 in swift (0) | 2016.11.27 |
ios 다국어 localize 사용하기 in swift (0) | 2016.11.24 |
ios 동적 button , switch 사용하기 in swift (0) | 2016.09.25 |
ios segue 사용하기 in swift (0) | 2016.09.20 |