2014-09-03 26 views
0

我的iOS 7.1应用程序有一个奇怪的Bug。请参阅下图。当我尝试在UITableView:didSelectRowAtIndexPath事件上推送Alarm-ViewController时发生这种情况。任何想法如何解决这个问题?推送到UINavigationController时遇到UIViewControllers问题 - iOS 7.1

enter image description here

代码:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 

    Alarm *alarm = _settings.sharedSettings[indexPath.row]; 

    AlarmViewController *alarmViewController = [[AlarmViewController alloc] initWithAlarm:alarm]; 
    alarmViewController.title = NSLocalizedString(@"TITLE", nil); 

    [self.navigationController pushViewController:alarmViewController animated:YES]; 
} 
+1

你正在用UIPickerView推视图控制器,它显示透明?是吗?也许你可以更好地解释问题。 – 2014-09-04 11:38:47

+0

是的,没有。好吧,让我试着更好地解释。我有一个TableViewController从那里我尝试推到其他ViewController(AlarmViewController)。 AlarmViewController在编辑模式下被拆分(Top:DatePicker,Bottom:SettingsTableView),类似于标准iOS7 AlarmClock-App。好的,现在AlarmViewController会推动,但在推动时(从TableViewController到AlarmViewController)在动画持续时间内与AlarmViewController叠加在TableViewController上。重叠只出现在AlarmViewController的顶部,但在两个方向。它更清晰?谢谢 – blub 2014-09-04 12:13:36

+0

@TiagoLira:好的,我可以解决我的问题。你给出正确的提示。你是对的,我只需要在AlarmViewController的视图中设置background-color = white,并且不再有透明度和重叠。谢谢! – blub 2014-09-04 12:28:28

回答

1

简单解决方案。 只需设置UIView的背景色。

UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 150)]; 
view.backgroundColor = [UIColor whiteColor]; 

//add other Controls to view 

self.view = view;