Swift&Objective-CiOS程序猿Swift

swift——一些有用的小Tips

2018-07-24  本文已影响32人  Bart_Simpson

UITableView

cell.accessoryType = .none
cell.accessoryView = getBlueRightArrow()

func getBlueRightArrow() -> UIView{
        let vi = UIImageView.init(frame: CGRect.init(x: 0, y: 14, width: 16, height: 16))
        vi.image = UIImage.init(named: "mine_RightArrow")
        return vi
}

上图就是用这种方法实现的效果。

    func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
        
        view.tintColor = UIColor.clear
        
    }
    
    func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int) {
        
        view.tintColor = UIColor.clear
        
    }

UITextField

关于Label的富文本可以去看看这个swift——富文本文字的简单使用

后续的各种小Tips会陆续更新上来!大家如果有什么Tips也可以留言给我,互勉!

上一篇 下一篇

猜你喜欢

热点阅读