开发者

iPad app displays Actionsheet with arrow direction down instead up

When displaying an actionSheet at any point in a view it displays an arrow with direction down (below the actionsheet) even though the actionSheet would have enough space in the view to display an "up" arrow.

In the iPad contacts app when editing a contact and pressing on "edit" in the profile photo an actionSheet with arrow direction up appears, so "up" should be standard.

Following code leads on iOS 3.2 to an "up" arrow, on iOS开发者_高级运维 4.2 and 4.3 to a "down" arrow. I tried different Rects and Views.

actionSheetXY = [[UIActionSheet alloc] initWithTitle:nil
                                            delegate:self
                                   cancelButtonTitle:NSLocalizedString(@"cancel",nil) 
                              destructiveButtonTitle:nil
                                   otherButtonTitles:NSLocalizedString(@"test",nil),nil];
actionSheetXY.actionSheetStyle = UIActionSheetStyleDefault;
actionSheetXY.delegate = self;
[actionSheetXY showFromRect:CGRectMake(100,200,320,320) inView:self.view animated:YES];

Is there a way to get an arrow with direction up?


the arrow will always point to this rectangle you have defined: CGRectMake(100,200,320,320)

if you want it to point to one particular place, you have to change this rectangle to the point you want the arrow to point.

If you want it to point to your edit button, you need to change the line to

[actionSheetXY showFromRect:[editButton frame] inView:self.view animated:YES];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜