ios系统自带的cell样式 怎么修改

2025-05-06 00:59:18
推荐回答(1个)
回答(1):

UITableView * tableView = [[UITableView alloc] initWithFrame:CGRectMake(20, 20, 400, 300) style:UITableViewStylePlain];

tableView.separatorColor = [UIColor redColor];

tableView.separatorInset = UIEdgeInsetsMake(0,80, 0, 80); // 设置端距,这里表示separator离左边和右边均80像素

tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;

tableView.dataSource = self;