zombie45
zombie's dev story
zombie45

공지사항

  • 분류 전체보기
    • iPhone
    • Study

인기 글

최근 댓글

최근 글

티스토리

반응형

블로그 메뉴

  • 홈
  • 태그
  • 미디어로그
  • 위치로그
  • 방명록
  • 글쓰기
전체 방문자
오늘
어제

태그

  • Flutter
  • cocoapods-binary-cache
  • 큰파일
  • FocusScope
  • 큰폴더
  • 오블완
  • 안드로이드
  • CI/CD
  • cache
  • actions
  • flutter l10n helper
  • Box2d cocos2dx cocos2d-x
  • textformfield
  • Nodejs node express expressjs
  • 자동배포
  • caching
  • UIViewController
  • flutter_localizations
  • code spell checker
  • intl
  • l10nization
  • cspell
  • nextFocus
  • 카카오 로그인
  • android_key_hash
  • 티스토리챌린지
  • TextInputAction
  • Animtaion
  • jks
  • appDelegate
hELLO · Designed By 정상우.
zombie45

zombie's dev story

iPhone

Underline text / title in UIButton

2020. 6. 10. 01:53

use NSAttributedString to underline the string itself

let btShop: UIButton = UIButton()
btShop.frame = CGRect(x: 40, y: 240, width: 320, height: 50)
let attributedString: NSAttributedString = NSAttributedString(string: NSLocalizedString("Buy", comment: ""), attributes:[
    NSAttributedString.Key.font : UIFont.systemFont(ofSize: 16.0),
    NSAttributedString.Key.foregroundColor : UIColor.gray,
    NSAttributedString.Key.underlineStyle:1.0
])
btShop.setAttributedTitle(attributedString, for: .normal)
self.view.addSubview(btShop)
반응형
저작자표시 (새창열림)

'iPhone' 카테고리의 다른 글

AWS Simple Notification Service p12  (0) 2020.06.10
Safe area / layout by code for iPhone X, XS, XR, XS Max  (0) 2020.06.10
rbenv install stuck at installing openssl  (0) 2020.06.09
iOS10 firebase crashlytics showing NSInternalInconsistencyException  (0) 2020.06.09
AWS SNS iOS push certificate  (0) 2016.07.28
    'iPhone' 카테고리의 다른 글
    • AWS Simple Notification Service p12
    • Safe area / layout by code for iPhone X, XS, XR, XS Max
    • rbenv install stuck at installing openssl
    • iOS10 firebase crashlytics showing NSInternalInconsistencyException
    zombie45
    zombie45
    잡다한 개발

    티스토리툴바