UITableView selected background color
테이블뷰가 선택 되었을 때 백그라운드 색을 지정해 주는 코드입니다.
일반적으로 퍼런색과 회색을 지정해 줄 수 있는데 다양한 색상으로 변경을 할 수 있습니다.
static NSString *CellIdentifier = @"VODCusCell";
VODCusCell *cell = (VODCusCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *arr = [[NSBundle mainBundle] loadNibNamed:@"VODCusCell" owner:self options:nil];
cell = [arr objectAtIndex:0];
UIView *selectionColor = [[UIView alloc] init];
selectionColor.backgroundColor = [UIColor colorWithRed:0.976 green:0.337 blue:0.125 alpha:1.000];// 원하시는 색을 설정
cell.selectedBackgroundView = selectionColor;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
}
코드는 위의 메소드에 입력해 주세요.
'IT > iOS' 카테고리의 다른 글
iOS random integer (0) | 2014.02.05 |
---|---|
iOS 7 UI Difference between Simulator and real Device (0) | 2014.02.05 |
navigation bar title color (0) | 2014.02.04 |
detailView 20pixel bug (0) | 2014.02.04 |
iOS6 특정뷰 회전 처리 (0) | 2014.02.04 |
iPhone emoji encoding decoding (0) | 2014.01.28 |
CopyPNGfile error (0) | 2013.12.05 |
D-day 구하기 (0) | 2013.11.21 |