티스토리 뷰
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier] autorelease];
}
cell.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image%d.jpg", indexPath.row+1]];
cell.textLabel.text = [data objectAtIndex:indexPath.row];
cell.detailTextLabel.text = @"row subtitle";
return cell;
}
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier] autorelease];
}
cell.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image%d.jpg", indexPath.row+1]];
cell.textLabel.text = [data objectAtIndex:indexPath.row];
cell.detailTextLabel.text = @"row subtitle";
return cell;
}
UITableViewCellStyleDefault: 보충 설명이 없음
UITableViewCellStyleSubtitle: 보충 설명을 하위로 작게 표시
UITableViewCellStyleValue1: 상세 텍스트를 파란색으로 셀의 오른쪽에 배치
UITableViewCellStyleValue2: 상세 텍스트를 파란색으로 셀의 왼쪽에 배치
UIImageView * imageView: 이미지 뷰
UILabel * textLabel: 셀의 텍스트 레이블
UILabel * detailTextLabel: 셀의 보충 설명
UIView *accessoryView: 셀의 엑세서리
'모바일 > iOS' 카테고리의 다른 글
SNS공유 라이브러리 ShareKit 0.2.1 iOS5 에서 Cancel 버튼 안먹는문제 해결 (0) | 2012.01.30 |
---|---|
모달 자식에서 부모창 Object 제어방법 (0) | 2012.01.30 |
Attribute Unavailable: Defines Presentation Context is not available prior to Xcode 4.2. (0) | 2012.01.18 |
테이블셀 오른쪽 끝 > 나타내기 (0) | 2012.01.18 |
iOS: 문자열에 포함된 엔티티 문자들을 엔/디코딩 (0) | 2012.01.16 |
댓글
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- sencha touch
- Mac
- 한글
- JQuery
- Docker
- IE
- macos
- Android
- Linux
- API
- nodejs
- 안드로이드
- nginx
- centos
- JSON
- PHP
- classic asp
- javascript
- CSS
- Debug
- iis
- 워드프레스
- IOS
- laravel
- git
- iphone
- ASP
- mssql
- Prototype
- Wordpress
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
글 보관함