Is it possible to add a border style to a UITableView? (Not BorderColor/BorderWidth)

后端 未结 5 667
逝去的感伤
逝去的感伤 2020-12-29 15:40

Is it possible to add a border style to a UITableView?

Not just bordercolor and borderwidth.

For example a grooved border style?

5条回答
  •  灰色年华
    2020-12-29 15:57

    You can't set the style, but you can simulate a pattern like a dotted line by using a pattern image and a UIColor.

    UIView *item;
    item.layer.borderColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"checkerboard.png"]].CGColor;
    

    Don't forget to add this to your headers:

    #import 
    

提交回复
热议问题