Iphone 在iPad应用程序中调整UIActionsheet的箭头方向

Iphone 在iPad应用程序中调整UIActionsheet的箭头方向,iphone,uiactionsheet,ipad,Iphone,Uiactionsheet,Ipad,实际上,我必须只显示带有上下箭头的操作表。我的视图中有不同的列。现在的问题是,当我点击第一列时,它会显示动作表,方向是向上的,但动作表的中间部分和它的指示第二列,所以我需要移动左边的箭头 我从下面的代码管理这些事情。但我无法移动最后一列右侧的箭头 float x=offset.x; float y=offset.y; float w=newPop.frame.size.width; float h=newPop.frame.size.height; if(offset.x < 150) {

实际上,我必须只显示带有上下箭头的操作表。我的视图中有不同的列。现在的问题是,当我点击第一列时,它会显示动作表,方向是向上的,但动作表的中间部分和它的指示第二列,所以我需要移动左边的箭头

我从下面的代码管理这些事情。但我无法移动最后一列右侧的箭头

float x=offset.x;
float y=offset.y;
float w=newPop.frame.size.width;
float h=newPop.frame.size.height;
if(offset.x < 150)
{
    x = 160;
    w = w-180;
}
else if(offset.x > 600)
{
     x= 600;
   //w= w+180;
}

CGRect myImageRect = CGRectMake(x, y, w, h);


[newPop showFromRect:myImageRect inView:_calDay animated:YES];
float x=offset.x;
浮动y=偏移量y;
float w=newPop.frame.size.width;
浮动h=newPop.frame.size.height;
如果(偏移量x<150)
{
x=160;
w=w-180;
}
否则如果(偏移量x>600)
{
x=600;
//w=w+180;
}
CGRect myImageRect=CGRectMake(x,y,w,h);
[newPop showFromRect:myImageRect inView:_calDay动画:是];
我通过减小箭头的宽度来控制箭头的左上方向。但不能用它来调整方向

如果你对此有任何解决办法,请告诉我。请检查下面的快照,我管理向上和向左的方向,但我需要向上和向右的方向


我建议大家只看一眼,把你的行动表放在里面。
像这样在popover中加载该视图

NSSet *allTouches = [event allTouches];
UITouch *touch = [[allTouches allObjects] objectAtIndex:0];
CGPoint p = [touch locationInView:self.view];


if(popoverController)
    [popoverController dismissPopoverAnimated:YES];

popOverController *obj_popOverController = [[popOverController alloc] initWithNibName:@"popOverController" bundle:nil];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:obj_popOverController];
popoverController = [[UIPopoverController alloc] initWithContentViewController:navController];
[popoverController setPopoverContentSize:CGSizeMake(320.0, 320.0)];
[popoverController presentPopoverFromRect:CGRectMake(p.x, p.y, 10, 10) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown  animated:YES];
[navController release];

我的建议是只看一眼,里面有你的行动表。
像这样在popover中加载该视图

NSSet *allTouches = [event allTouches];
UITouch *touch = [[allTouches allObjects] objectAtIndex:0];
CGPoint p = [touch locationInView:self.view];


if(popoverController)
    [popoverController dismissPopoverAnimated:YES];

popOverController *obj_popOverController = [[popOverController alloc] initWithNibName:@"popOverController" bundle:nil];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:obj_popOverController];
popoverController = [[UIPopoverController alloc] initWithContentViewController:navController];
[popoverController setPopoverContentSize:CGSizeMake(320.0, 320.0)];
[popoverController presentPopoverFromRect:CGRectMake(p.x, p.y, 10, 10) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown  animated:YES];
[navController release];

行动单?不是UIPopOverController?是的,我正在显示UIActionsheet,带有3.2版showFromRect中提供的新API以显示ActionSheet看起来像popover.UIActionsheet吗?不是UIPopOverController?是的,我正在显示UIActionsheet,带有3.2版showFromRect中提供的新API,以显示ActionSheet,看起来像popover。