원으로된 png 리소스를 가지고 왼쪽 둥글게 가운데 텍스트 오른쪽 둥글게
이렇게 생긴 버튼으로
가변 길이로 버튼을 만들려고 하면 어찌 해야 하는가 이다.
Images.xcassets 를 선택 하면 다음과 같은 원 이미지가 있다고 할 때

메뉴에서 Editor -> Show Slicing

아래 처럼 Start Slicing 버튼이 보인다.

원하는 자르기 방향을 선택 하고

그중 하나를 선택 하면 나뉘어진 크기를 설정 할 수 있다.

그리고 UI Button에 이미지를 background로 설정 하면 storyboard 상에서는 찌그러진 상태
그대로 나오지만 runtime에는 원하는 예쁜 상태로 나온다.
댓글 없음:
댓글 쓰기