2013-09-02 1 views
0

내 앱에는 내가 선택할 가치가 많기 때문에 UIActionSheet을 사용했습니다.UIActionSheet iOS의 선택된 배경색

다음 그림이 표시됩니다. 보시다시피

enter image description here

은 선택한 행 ColorBlue입니다.

해당 색상을 Gray으로 변경하고 싶습니다.

어떻게 변경할 수 있습니까?

+0

시도 .. – Bala

+0

http://stackoverflow.com/q/4049103/1059705 – Bala

답변

1
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet 
{ 

     //Gets an array af all of the subviews of our actionSheet 
     NSArray *subviews = [actionSheet subviews]; 

     for (UIView *v in subviews) 
     { 
      if ([v isKindOfClass:[UIButton class]]) 
      { 
       UIButton *b = (UIButton*)v; 
       [b setBackgroundImageByColor:[UIColor gray] forState:UIControlStateHighlighted ]; 
      } 
     } 
} 

코드 시도 .. 선택시 배경 버튼에 청색 화상이나 층을 추가

+0

setBackgroundImageByColor 오류 보여주는 형. –

+0

어떤 오류가 로그에 표시됩니까 .... – Jitendra

+0

setBackgroundImageByColor 메소드가 없습니다. 그 오류 표시 –