I think for startup you can go over here
How to display the UITableView programmatically?
Ok if you know how to load a uitableview than I think you can get started with complex part.
You need to add this line of code in your cellForRow method
You need to set the frame size and image name according to your requirement
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:cellIdentifier];
}
if(indexPath.row == 0)
{
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image1.png", ]];
[cell.contentView addSubview:imageView];
[imageView release];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image2.png", ]];
[cell.contentView addSubview:imageView];
[imageView release];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image3.png", ]];
[cell.contentView addSubview:imageView];
[imageView release];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image4.png", ]];
[cell.contentView addSubview:imageView];
[imageView release];
}
else if(indexPath.row == 1)
{
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image5.png", ]];
[cell.contentView addSubview:imageView];
[imageView release];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image6.png", ]];
[cell.contentView addSubview:imageView];
[imageView release];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image7.png", ]];
[cell.contentView addSubview:imageView];
[imageView release];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image8.png", ]];
[cell.contentView addSubview:imageView];
[imageView release];
}
else if(indexPath.row == 2)
{
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image9.png", ]];
[cell.contentView addSubview:imageView];
[imageView release];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image10.png", ]];
[cell.contentView addSubview:imageView];
[imageView release];
}
else
{
// Do something here
}
return cell;
}
Edit:
@Christy you can have a button that can make a table view scroll. But iphone users are used to see the scroll bar on the right of the table to see if the table has any more data or not.
But if you want to have a Button that scrolls the table than here is the code
In your cellForRow method of tableView in this block else if(indexPath.row == 2){}
add a UIButton with a down arrow like this
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(220.0f, 5.0f, 150.0f, 38.0f)];
[button setImage:[UIImage imageNamed:@"Arrow"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(doSomething) forControlEvents:UIControlEventTouchUpInside];
[cell addSubview:button];
[button release];
and in the selector method
- (void)doSomething
{
[tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:3 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES]
}