Category Archives: iOS

UIButton设置按下背景色

http://stackoverflow.com/questions/14523348/how-to-change-the-background-color-of-a-uibutton-while-its-highlighted

UIButton只能设置按下的背景图片,所以我们可以曲线救国,将背景色转换为一张图片

Return an image made from the highlight colour you want. This could also be a category[......]

继续阅读

UITextView自动换行的解法

多行文本,如何让UITextView自动换行,且高度自适应
view.addSubview(textView)
let width = UIScreen.main.bounds.width - 40
let size = textView.sizeThatFits(CGSize(width: width, height: CGFloat.greatestFiniteMagnitude))
textView.snp.makeC[......]

继续阅读