반응형 setBackgroundColor:forState1 iOS UIButton SetBackgroundColor forState: 예전에 네이버 블로그에 올렸던 포스팅인데 오늘 또 사용할 일이 있어서 찾아보니 보인다. 예전 포스팅은 UIButton Category Method로 작업을 했는데 이번에는 UIButton을 상속받아 TabBarItem을 하나 만들고 InitWithFrame할 때 아예 self의 setBackgroundColor와 같은 기능을 하는 setBackgroundImage:forState를 추가해서 만들도록 구현을 했다. @implementation TabBarItem /** * 기본 UI버튼 생성 */ - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self setTitleColor:_col.. 2020. 4. 24. 이전 1 다음 반응형