Drawing Game Center like tableview cells

后端 未结 2 543
再見小時候
再見小時候 2021-02-10 16:40

I\'ve now added a bounty which will be awarded to anyone who can take the three images below and produce a working implementation of a UITableView that mimicks the l

2条回答
  •  南笙
    南笙 (楼主)
    2021-02-10 16:43

    They are removing all of the default drawing/borders and simply using custom cells with their own images.

    Regarding your edit: This is incorrect. I've achieved that behavior too. , before, I don't recall exactly how I did it, I think I set the background image directly on the table view, not the view behind it. (See the code below.)

    EDIT:

    Here's the code I used to mimic the behaviour of cells "dragging" portions of the background with them:

    - (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.tableView setRowHeight:65.0];
    
    [self.tableView setBackgroundColor:[UIColor clearColor]];
    [self.tableView setBackgroundView:nil];
    [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"metal_settings.png"]]];    
    
    [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
    
    [self setContentSizeForViewInPopover:CGSizeMake(300, 300)];
    
    }
    

    I've put this in a UITableViewController subclass and have inherited from that in several instances. If you look closely, the "color"/texture outside of the cells moves with the cells.

提交回复
热议问题