Skip to content

Instantly share code, notes, and snippets.

@codeOfRobin
Created April 1, 2015 18:08
Show Gist options
  • Save codeOfRobin/e8bded64aec15fc206f0 to your computer and use it in GitHub Desktop.
Save codeOfRobin/e8bded64aec15fc206f0 to your computer and use it in GitHub Desktop.
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (section==0) {
return 1;
}
else
{
return [self.data count];
}
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section==0)
{
return 250;
}
else
{
return 40;
}
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"cell"];
if (!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
}
if (indexPath.section==0)
{
cell.backgroundColor=[UIColor clearColor];
[cell.textLabel setText:@""];
}
else
{
[cell.textLabel setText:[self.data objectAtIndex:indexPath.row]];
[cell setBackgroundColor:[UIColor greenColor]];
[cell.textLabel setText:[self.data objectAtIndex:indexPath.row]];
}
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment