2014-06-23 3 views
0

나는의 backgroundColor있는 UITableViewCell의 Notworking

cell.contentView.backgroundColor = [UIColor colorWithRed:8.0 green:210.0 blue:11.0 alpha:1.0]; 

처럼 내가

cell.contentView.backgroundColor = [UIColor grayColor]; 

같이 할 경우 그 작동하지 않습니다, 그러나, 그 다음 작품 내있는 UITableViewCell의 배경 색상을 설정하고있다. 어떤 도움

+0

colorWithRed에 대한 문서를보고하십시오 : 녹색 : 청색 : 알파 : 매개 변수가 취하는 값을 기록하십시오. – rdelmar

+0

255로 나누어야합니다. 이 기사를 참조하십시오. http://stackoverflow.com/questions/5641523/using-uicolor-colorwithredgreenbluealpha-doesnt-work-with-uitableview-sep – pqteru

답변

1

UIColor 작동하는 RGB에게 값을 얻기 위해 0과 1 사이 을 정의 할 (UIColor class reference)가 :

cell.contentView.backgroundColor = [UIColor colorWithRed:8.0f/255.0f green:210.0f/255.0f blue:11.0f/255.0f alpha:1.0f];