2012年08月06日

UIActionSheetで長文タイトルを実装する

UIActionSheetでinitWithTitleでタイトル文字で長文を設定すると、ログに
Presenting action sheet clipped by its superview. Some controls might not respond to touches.
と表示される。
これを回避する手法。


修正前:
UIActionSheet *actionSheet = [[[UIActionSheet alloc]
initWithTitle: @"長文"
delegate: self
cancelButtonTitle: NSLocalizedString(@"CANCEL", nil)
destructiveButtonTitle: nil
otherButtonTitles:
@"OK", nil]
autorelease];

[actionSheet showInView: self.view];


修正後:
UIActionSheet *actionSheet = [[[UIActionSheet alloc]
initWithTitle: @"長文"
delegate: self
cancelButtonTitle: NSLocalizedString(@"CANCEL", nil)
destructiveButtonTitle: nil
otherButtonTitles:
@"OK", nil]
autorelease];

[actionSheet showInView: self.tabBarController.tabBar];;


showInViewを、self.viewではなく、self.tabBarController.tabBarにする。


参考記事:
http://stackoverflow.com/questions/10235065/uiaction-sheet-and-alert-trouble


posted by mobileDeveloper at 12:06 | Comment(0) | TrackBack(0) | UIActionSheet | このブログの読者になる | 更新情報をチェックする
この記事へのコメント
コメントを書く
お名前:

メールアドレス:

ホームページアドレス:

コメント:

認証コード: [必須入力]


※画像の中の文字を半角で入力してください。
※ブログオーナーが承認したコメントのみ表示されます。

この記事へのトラックバック