2011-02-22 127 views
0

布局...弹出不打开按钮

我有一个UIToolbar加载一个视图与几个按钮。 onpress中的其中一个按钮应显示一个弹出窗口。

它的确如此。然而,弹出窗口似乎开放在0,0。

-(IBAction)FilterButtonPressed:(id)sender 
{ 
if (_FilterViewController == nil) { 
    self.FilterViewController = [[[FilterViewController alloc] initWithStyle:UITableViewStylePlain] autorelease]; 
    _FilterViewController.filterViewDelegate = self; 
    self.FilterViewPopover = [[UIPopoverController alloc] initWithContentViewController:_FilterViewController]; 

} 
NSLog(@"Button...: %@",NSStringFromCGRect(self.FilterButton.frame)); 
[self.FilterViewPopover presentPopoverFromRect:self.FilterButton.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 
} 

的读取的NSLog:

Button...: {{0, -4.38184}, {0, 4.76182e-39}} 

这是......只是奇怪..

任何建议,为什么FilterButton不知道它在哪里?

回答

2

有关为什么FilterButton不知道它在哪里的任何建议?

看起来像是未初始化/未正确初始化。你所有的网点设置正确吗?每当“我的xyz对象行为不正常”时,检查您的网点通常是业务的第一顺序(请注意,该操作可以通过按钮挂钩,但您的班级中的按钮链接可能不会。状态从“发件人”投射到“UIButton *”

+0

就是这样......它没有正确地连接起来......该死的,我一直在用这种方式来弥补/ way/long。请注意,但是,谢谢 – Critter 2011-02-22 18:13:53

相关问题