2012-05-12 6 views
0

デフォルトでは、iPhoneのランドスケープモードのUIActionSheetは画面の幅(480)をとります。UIActionSheetの幅を変更する

幅を最小限にしようとしました。 Appleはどのようにして幅を変更できますか?Appleはこの動作を受け入れますか?

全コード:

actionSheet = [[UIActionSheet alloc] initWithTitle:@"\n\n\n\n\n\n\n\n\n\n\n" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil,nil]; actionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque; actionSheet.delegate = self; [actionSheet showInView:self.view]; [actionSheet setBounds:CGRectMake(0 , 0, 200, 320)]; 
+0

私はUIActionシートの境界を設定しようとしました。 [actionSheet setBounds:CGRectMake(0、0、200、320)]; – Bharathi

+0

actionSheet = [[UIActionSheetのalloc] initWithTitle:@ "\ N \ N \ N \ N \ N \ N \ N \ N \ N \ N \ n" は デリゲート:自己 cancelButtonTitle: destructiveButtonTitleゼロ: otherButtonTitlesゼロ: nil、nil]; actionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque; actionSheet.delegate = self; [actionSheet showInView:self.view]; [actionSheet setBounds:CGRectMake(0、0、200、320)]; – Bharathi

+1

あなたは[this](http://stackoverflow.com/a/1860168/932011)を読んでください。あなたは[UIView](https://github.com/homeyer/CustomUIActionSheet)を使って説明を使用することができます。アクションシートのようにスライドするカスタムビューを作成することができます – akk

答えて

1

私は私はそれがどんなアプリで実装見たことがないと確信しているとして、この能力がUIActionSheetに内蔵されているとは思いません。カスタムUIViewを作成し、UIViewAnimationを使用して画面の下からスライドさせます。カスタムアクションシートの背後にあるビューにアクセスできないようにするには、メインビューと画面のフルサイズをカバーするカスタムアクションシートの間に入るビューを作成する必要があります。

関連する問題