iPad에서는 새로운 iOS 7 UIActionSheet가 많은 버튼으로 올바르게 표시되지 않습니다.많은 버튼이있는 Xcode iPad UIActionSheet가 올바르게 표시되지 않습니다. iOS7
스크롤 할 때 UIActionSheet의 배경을 지우지 마십시오. 버튼이 백그라운드 배경으로 고정되었습니다.
내 코드 :이 답변의 기반으로
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet {
actionSheet.backgroundColor = [UIColor whiteColor];
for (UIView *subview in actionSheet.subviews) {
subview.backgroundColor = [UIColor whiteColor];
}
}
:
UIActionSheet *popupQuery = [[UIActionSheet alloc];
for (int i=0; i<[ParamAllList count]; i++)
{
NSMutableDictionary *Param = [ParamAllList objectAtIndex:i];
[popupQuery addButtonWithTitle:[Param valueForKey:@"name"]];
[[[popupQuery valueForKey:@"_buttons"] objectAtIndex:[[popupQuery valueForKey:@"_buttons"] count]-1] setImage:[UIImage imageNamed:@"add40icon.png"] forState:UIControlStateNormal];
}
popupQuery.actionSheetStyle = UIActionSheetStyleAutomatic;
[popupQuery showFromRect:Button_Settings.frame inView:Button_Settings.superview animated:YES];
당신이 당신의 UIActionSheet –
UIActionSheet * popupQuery = [[UIActionSheet ALLOC]를 생성 코드를 추가하십시오; for (int i = 0; i <[ParamAllList count]; i ++) { NSMutableDictionary * Param = [ParamAllList objectAtIndex : i]; [popupQuery addButtonWithTitle : [매개 변수 값 : @ "name"]]; [: [popupQuery valueForKey : @ "_ buttons"] objectAtIndex : [[popupQuery valueForKey : @ "_ 단추 수] -1] setImage : [UIImage imageNamed : @"add40icon.png "] forState : UIControlStateNormal]; } popupQuery.actionSheetStyle = UIActionSheetStyleAutomatic; [popupQuery showFromRect : Button_Settings.frame inView : Button_Settings.superview animated : YES]; – Constantinus
기본적으로 그림이없는 경우에도 동일한 작업을 수행합니다. UIActionSheet * popupQuery = [[UIActionSheet alloc] initWithTitle : @ "test"위임 : self cancelButtonTitle : @ ""destructiveButtonTitle : @ "Cancel"otherButtonTitles : "hi", @ "hi", @ "hi", @ "hi", @ "hi", @ "hi", @ "hi" , "hi", ""hi "," "hi", ""hi "," "hi", ""hi "," , @ "hi", @ "hi", @ "hi", @ "hi", @ "hi", nil]; 이런 식으로 엉망이됩니다 .... 버튼의 양과 관련이 있습니다. – dan