Moon is a Merciful Mistress.




今日のiPhoneプログラミング
2008年12月11日23:45
久しぶりにはまりました(;´Д`)
UIActionSheetが効かないの。それも下のボタン二つ。
コードはこんな感じ。
UIActionSheet* actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Drop" otherButtonTitles:@"Trade",@"Equip",nil];
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[actionSheet showInView:self.view];
[actionSheet release];

何故か2.1ではちゃんとできて(ビューの位置がおかしくなるけど)2.2では駄目で、さんざん悩んでサンプル見てもわからなくて、ググったら似たような悩みの人が見つかって、

・・・ついでに答えも見つかりました(;´Д`)
[actionSheet showInView:self.view.window];
が正解。
・・・確かにビューからアクションシートがはみ出てるもんなあ(;´Д`)ってわかるかこんなの。

ということで、今日は全く進まず。


by7n-ysmr@asahi-net.or.jp