1
테이블 뷰 섹션 헤더 텍스트를 기본 UI가 텍스트를 통해 빛나는 역동적 인 스타일로 렌더링하고 싶습니다. 나는 다음을 시도했지만, 마치 nil
을 반환 한 것처럼 헤더에 아무 것도 나타나지 않습니다.테이블 뷰 헤더에 UIVibrancyEffect를 구현하는 방법은 무엇입니까?
override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
//Add vibrancy text effect
let blurEffect = UIBlurEffect(style: .Light)
let vibrancyEffect = UIVibrancyEffect(forBlurEffect: blurEffect)
let vibrancyEffectView = UIVisualEffectView(effect: vibrancyEffect)
//Label for vibrant text
let vibrantLabel = UILabel()
vibrantLabel.text = "testing"
vibrantLabel.font = UIFont.systemFontOfSize(11.0)
vibrantLabel.textColor = UIColor(white: 0.64, alpha: 1)
vibrancyEffectView.contentView.addSubview(vibrantLabel)
return vibrancyEffectView
}