Answers
背景图。。。 或者:
import UIKit
let borderColor = UIColor.lightGrayColor()
let tblFrame = CGRect(x: 0, y: 0, width: 200, height: 80)
let tblView = UITableView(frame: tblFrame)
tblView.rowHeight = 41
tblView.separatorColor = borderColor
tblView.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
let bgView = UIView(frame: tblFrame)
bgView.layer.borderColor = borderColor.CGColor
bgView.layer.borderWidth = 1
bgView.layer.cornerRadius = 10
tblView.backgroundView = bgView
tblView.addSubview(UITextField())
tblView.addSubview(UITextField())
直接粘贴到Playground:
也是你想要的效果,别的方法应该也很多,看个人喜好了。。。
Saber.L
answered 11 years, 1 month ago