2011-12-21 1 views
0

이전에는 버튼이보기의 일부에서 터치에 반응하는 것과 같은 문제가 발생했습니다. 투명 영역이있는 이미지 뷰가 높은 z 레벨에 있다는 것을 알았습니다. 중복이 발생한 부분을 가려 둡니다. 이는 애매한보기가 추가되기 전에 버튼이 하위보기로 추가 되었기 때문입니다.iPhone 작업 시트 취소 버튼 만 센터 근처에있는 터치에 응답합니다.

액션 시트의 경우 다른 어떤 것보다 가장 높은 z 레벨에 있다고 생각했습니다. 액션 시트가 방금 초기화되고 표시되었으므로 무언가가 버튼을 덮고있는 것을 볼 수있는 방법이 없습니다.

(애플 리케이션을 범용 앱으로 변환 한 후 iOS 4.3 및 5.0에서 테스트 중입니다.) iPad의 작업 시트에 취소 버튼이 없습니다.이 문제는 iPhone 시뮬레이션시 존재합니다. iOS 4.3 및 5.0 용)

문제의 원인에 대한 다른 아이디어가 있습니다. 이 서브 클래 싱 된 액션 시트에 대한 때문에

여기 UPDATE 이것이 바로 ShareKit에서,도 도움이 될 수 있습니다, 액션 시트를

- (void) shareButtonPressed { 

    SHKItem *item = [SHKItem larkspreeSearchResult:searchResult]; 
    item.image = eventImageRaw; 

    // Get the ShareKit action sheet 
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; 

    // Display the action sheet 
    [actionSheet showInView:self.view]; 

} 

을 표시하는 코드입니다.

+ (SHKActionSheet *)actionSheetForType:(SHKShareType)type 
{ 
SHKActionSheet *as = [[SHKActionSheet alloc] initWithTitle:SHKLocalizedString(@"Share") 
                 delegate:self 
             cancelButtonTitle:nil 
            destructiveButtonTitle:nil 
             otherButtonTitles:nil]; 
as.item = [[[SHKItem alloc] init] autorelease]; 
as.item.shareType = type; 

as.sharers = [NSMutableArray arrayWithCapacity:0]; 
NSArray *favoriteSharers = [SHK favoriteSharersForType:type]; 

// Add buttons for each favorite sharer 
id class; 
for(NSString *sharerId in favoriteSharers) 
{ 
    class = NSClassFromString(sharerId); 
    if ([class canShare]) 
    { 
     [as addButtonWithTitle: [class sharerTitle] ]; 
     [as.sharers addObject:sharerId]; 
    } 
} 

// Add More button 
[as addButtonWithTitle:SHKLocalizedString(@"More...")]; 

// Add Cancel button 
[as addButtonWithTitle:SHKLocalizedString(@"Cancel")]; 
as.cancelButtonIndex = as.numberOfButtons -1; 

return [as autorelease]; 
} 

showInView 메서드가 재정의되지 않았습니다.

+0

문제의보기 컨트롤러에서 코드를 붙여 넣으십시오. 구체적으로'-showInView :'를 액션 시트에 보냅니다. –

+0

일부 코드가 업데이트되었습니다. 더 많은 도움이 될지 알려주세요. – Jim

+0

어떤 종류의 바가 있습니까? 이 뷰 컨트롤러가 툴바가 설정된 UINavigationController 또는 UITabBarController의 일부인 경우 모든 액션 시트를 부모 컨트롤러의 뷰에 표시해야합니다. 예를 들어,'[actionSheet showInView : self.navigationController.view];'또는'[actionSheet showInView : self.tabBarController.view];'. –

답변

2

이보기 컨트롤러가 도구 모음이 구성된 UINavigationController 또는 UITabBarController의 일부인 경우 모든 작업 시트를 상위 컨트롤러보기에 표시해야합니다. 예를 들어, [actionSheet showInView:self.navigationController.view]; 또는 [actionSheet showInView:self.tabBarController.view];입니다.

+0

이것은 나를 위해 일했습니다. 고마워요. – c0d3Junk13