UITableView create 4 square

后端 未结 2 1820
陌清茗
陌清茗 2020-12-22 07:20

I want to create calendar view with UITableView

I want to have 4 square in each rows like the below picture:

would you please help me, how can I have 4 squ

2条回答
  •  遥遥无期
    2020-12-22 07:50

    Try out this code:-

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
       static NSString *CellIdentifier = @"Cell";
    
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero] autorelease]; 
        }
       cell.selectionStyle = UITableViewCellSelectionStyleNone;
    int column = 4;
    
       for (int i=0; i

    Column will number of items you want in one cell.

提交回复
热议问题