iOS7.0 +를 타겟팅하는 SDK8.1이 포함 된 Swift 프로그래밍 언어를 사용하여 UIActionSheet를 만듭니다.UIActionSheet가 두 개의 버튼을 허용하지 않습니다
//Opens action sheet for image selection
@IBAction func showActionSheet(){
if(UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera)){
if(images.count >= Numbers.LIMIT_IMAGES){
lblError.displayMessage(FAUErrorLabel.MessageLevel.INFO, message: Messages.MAXIMAGES)
}
else{
var actionSheet = UIActionSheet(title: "Choose a Picture Method", delegate: self, cancelButtonTitle: "Cancel", destructiveButtonTitle: nil, otherButtonTitles: "Gallery", "Take Photo")
actionSheet.showInView(self.view)
}
}
else{
lblError.displayMessage(FAUErrorLabel.MessageLevel.ERROR, message: Messages.NOCAMERA)
}
}
그러나이 취소 버튼과 두 개의 "otherButtonTitles"의 조합으로 또 다른 하나의 버튼이 존재하는 것처럼 표시 : 아래의 코드는 내 액션 시트 작성을 보여줍니다. "사진 찍기"버튼을 터치 할 수 없습니다. iOS8.0에는 두 개의 버튼이 분리되어 있으며 "사진 촬영"버튼을 터치 할 수 있습니다.
iOS7.1
iOS8.1
어떻게 양쪽에 두 개의 버튼이 iOS7.1에서 만질 수받을 수 있나요?
감사합니다.
두 스크린 샷에는 3 개의 버튼이 있습니다. 그렇지 않습니다. –
네, 외모가 잘 작동합니다. –
@ Daij-Djan 첫 번째 스크린 샷은 ios7.1의 두 버튼 사이에 별다른 차이가 없으며 두 번째 버튼 인 "사진 촬영"을 클릭 할 수 없습니다. 사용자 상호 작용이 없습니다. 갤러리와 취소 만 선택할 수 있습니다. – steventnorris