2011-02-08 1 views
1

액션 시트가있는 피커 뷰와 날짜 선택기를 사용했으며 아이폰에서 정상적으로 작동합니다. 나는 ipad에 대한 내 아이폰 애플 리케이션을 업그레이 드했습니다. 난 액션 시트 속성을 자동 크기 설정하지만 아이 패드에 표시되지 않고, 내가 회전 할 때 iphone.Here은 아이 패드에 Actionsheet를 사용하여 염두에 두어야Ipad/iphone..action sheet

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Select Payment Type" 
                 delegate:self 
              cancelButtonTitle:@"Done" 
             destructiveButtonTitle:@"Cancel" 
              otherButtonTitles:nil]; 


// Add the picker 
picker = [[UIPickerView alloc] initWithFrame:CGRectMake(0,185,0,0)]; 

picker.delegate = self; 
picker.showsSelectionIndicator = YES; // note this is default to NO 
picker.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; 
[actionSheet addSubview:picker]; 
[actionSheet showInView:self.view]; 
[actionSheet setBounds:CGRectMake(0,0,320, 700)]; 
actionSheet.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleTopMargin 
|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleBottomMargin; 
[picker release]; 
[actionSheet release]; 

답변

0

한 점은 내 코드가 팝 오버의 ViewController로 표시된다는 점이다. 그것은 iPad의 액션 시트의 기본 동작입니다.

환호

+0

그래서 어떻게 ipad와 아이폰에서 같은 것을 사용할 수 있습니까 ?? –

+0

iPad에서 사용하려는 경우 popover Viewcontroller와 동일한 코드를 사용해야합니다. – Aditya

+0

확인을 클릭하면 아이폰에서도 작동 할 수있는 popover viewcontroller를 사용해야합니까? ipad 및 iphone에 대해 다른 코드를 작성하고 싶지 않습니다. –