- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// Create
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
//cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
}
// Configure
switch (indexPath.row) {
case 0:
cell.textLabel.text = @" Evolutions";
cell.backgroundColor=[UIColor clearColor];
cell.textLabel.textColor=[UIColor whiteColor];
CGRect myImageRect =CGRectMake(20,10,75,80);
UIImageView *imageView = [[UIImageView alloc] initWithFrame:myImageRect];
[imageView setImage:[UIImage imageNamed:@"page-1.jpg"]];
[cell addSubview :imageView];
[imageView release];
UIButton *btnView= [UIButton buttonWithType:UIButtonTypeRoundedRect];
[btnView addTarget:self action:@selector(View:)forControlEvents:UIControlEventTouchDown];
[btnView setTitle:@"View" forState:UIControlStateNormal];
[btnView setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
btnView.frame=CGRectMake(235,36, 72,30 );
[ cell addSubview: btnView];
break;
Я хочу создать адресную книгу, подобную этой, и использовать этот код.