creating border for uitableview

后端 未结 3 820
再見小時候
再見小時候 2020-12-14 16:47

I am using a uitableview and scrollview in a uiview. How to set a border for table or scrollview?

3条回答
  •  盖世英雄少女心
    2020-12-14 17:30

    This works quite well for me:

    CALayer *layer = _tableView.layer;
    [layer setMasksToBounds:YES];
    [layer setCornerRadius: 4.0];
    [layer setBorderWidth:1.0];
    [layer setBorderColor:[[UIColor colorWithWhite: 0.8 alpha: 1.0] CGColor]];
    

    The rounded borders look a little more iOS.

提交回复
热议问题