2011-08-22 4 views
2

셀의 배경색을으로 설정하는 방법이 있습니까? 순간을 위해 나는이 코드를 사용하고 있습니다 : 나는 예상대로 enter image description here그룹화 된 UITableViewCell에서 배경색을 지정하십시오.

불행하게도, 테두리, 선택된 모드에서 무승부 잘하지 않습니다 여기

UIImageView* selectedBackgroundCell = [[[UIImageView alloc] initWithFrame:CGRectNull] autorelease]; 
    [selectedBackgroundCell setImage:[UIImage imageNamed:@"cell_hover_bg.png"]]; 
    [cell setSelectedBackgroundView:selectedBackgroundCell]; 


    [cell setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"cell_bg.png"]]]; 

을하고하는 것은 결과입니다. 이 문제를 해결하는 방법을 알고 계십니까?

+0

가능한 [그룹화 된 표보기의 배경색/테두리 색을 사용자 정의하는 방법] (http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of) -a-grouped-table-view) – rckoenes

+0

또한 중복 된 http://stackoverflow.com/questions/281515/how-to-customize-the-background-color-of-a-uitableviewcell – ennuikiller

+0

중복되지 않습니다. 배경색을 추가 할 수는 있지만 선택한 배경색은 추가 할 수 없습니다. Thks –

답변

0

내가 아는 한 유일한 방법은 머리말과 꼬리말 2 개의 새로운 이미지를 만들고 요청한 행이 첫 번째 또는 마지막 일 때로드하는 것입니다.

+0

셀이 선택되었는지 여부를 지정하는 대리자 메서드가 있습니까? cellWillBeSelected 및 cellWillBeUnselected와 같은 –

+0

tableView : willSelectRowAtIndexPath : 여기서 참조를 확인하십시오. http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableViewDelegate_Protocol/Reference/Reference.html – andreamazz

+0

불행히도이 메소드는이 컴 포지먼트를 구현하지 않습니다. 벌써 해봤 어. 도와 줘서 고맙다. –

관련 문제