2016-03-28 2 views
5

Как добиться тени в таблицеViewView в UITableViewController.тень секции UITableView

+0

Попробуйте http://stackoverflow.com/questions/13395362/shadow-around-a-section-of- uitableview? rq = 1 – dip

+0

проверял его уже не делает тень в разделах .. он забрасывает тень в заголовке раздела – nik

+0

Вы хотите, чтобы эта тень в заголовке раздела записывалась? или в целом разделе – HardikDG

ответ

3

Добавьте этот метод, чтобы получить тень от UITableView Раздел Этот ответ в Swift3

func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { 
    let shadowView = UIView() 
    let gradient = CAGradientLayer() 
    gradient.frame.size = CGSize(width: myTab.bounds.width, height: 15) 

    let stopColor = UIColor.gray.cgColor  
    let startColor = UIColor.white.cgColor  

    gradient.colors = [stopColor, startColor]  
    gradient.locations = [0.0,0.8] 

    shadowView.layer.addSublayer(gradient)  

    return shadowView 
}