当我提出我UIViewController同modalPresentationStyle父的UINavigationController设置UIModalPresentationCurrentContext,在UIViewController不滑动,没有使用过渡.
这是我的代码:
UIViewController *viewController = [[UIViewController alloc] init];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
navController.navigationBarHidden = YES;
self.navigationController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentViewController:navController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
当我没有设置modalPresenttionStyle,一切正常.但我需要这种风格,因为我希望UIViewController礼物是叠加的.
BTW:当ViewController被解雇时,动画效果很好.
我试图绘制图形,我想用自定义颜色填充图形区域.但是颜色应该只在我用来绘制折线图的数据线下面,剩下的部分应该是这样的.
我正在使用核心情节绘制图表.我试图在绘图区域绘制我的图形,但它包含白色背景.但我想用我自己的背景绘制图形.这是我的代码.
// setting frame of graph
CGRect frame = [self.hostingView bounds];
self.graph = [[[CPTXYGraph alloc] initWithFrame:frame] autorelease];
// Add some padding to the graph, with more at the bottom for axis labels.
self.graph.plotAreaFrame.paddingTop = 10.0f;
self.graph.plotAreaFrame.paddingRight = 10.0f;
self.graph.plotAreaFrame.paddingBottom = 25.0f;
self.graph.plotAreaFrame.paddingLeft = 30.0f;
// set background color of plot area by fill property and CPTColor
self.graph.plotAreaFrame.plotArea.fill=[(CPTFill *)[CPTFill alloc] initWithColor: [CPTColor colorWithComponentRed:0.8 green:0.8 blue:0.8 alpha:1.0]];
// add graph to hosting view by hostedGraph property of hostingView
self.hostingView.hostedGraph = self.graph;
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,我试图改变颜色,但我想在y轴上绘制每个刻度线的水平虚线.