2012-01-11 2 views
0

나는 UIActionsheet를 가지고있다. 단추의 색상을 변경해야합니다.UIA 시트에서 버튼을 바꾸는 방법

-(IBAction)showActionSheet:(id)sender { 

    UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:self cancelButtonTitle:@"Cancel Button" destructiveButtonTitle:@"Destructive Button" otherButtonTitles:@"Other Button 1", @"Other Button 2", nil]; 

    popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque; 

    [popupQuery showInView:self.view]; 

    [popupQuery release]; 

} 

this 같은 UIActionsheet 표시됩니다. 빨간색 버튼 2 개, 회색 버튼 2 개, 검정색 취소 버튼. 처음 3 개의 버튼이 회색이고 마지막 버튼이 검은 색이어야합니다. 어떻게 프로그래밍 방식으로이 작업을 수행 할 수 있습니까?

+0

이 라이브러리를 확인하십시오 : https://github.com/gloomcore/UICustomActionSheet –

+0

이렇게하려면 라이브러리를 추가하지 않고이 작업을 수행 할 수있는 다른 방법이 없습니까? 이 라이브러리를 포함하면 사과가 내 앱을 수락할까요? – Illep

답변

3

파괴 단추는 자동으로 빨간색으로 표시됩니다. 액션 시트를 만들 때 파괴적인 버튼 제목을 nil으로 설정하고 회색 버튼 3 개에 대해서만 otherButtonTitles 인수를 사용하십시오.

관련 문제