答案 0 :(得分:2)
尝试
-(void)addBottomBorderToView:(UIView *)view{
UIView *bottomBorder = [[UIView alloc]initWithFrame:CGRectMake(0,view.frame.size.height - 1, view.frame.size.width, 1)];
bottomBorder.backgroundColor = UIColor.darkGrayColor;
[view addSubview:bottomBorder];
}
迅速:
func addBottomView(view : UIView){
let bottomView = CGRect(0,view.frame.size.height-1,view.frame.size.width,1)
bottomView.backgroundColor = UIColor.darkGrayColor
view.addSubView(bottomView)
}