1

我正在为Kony应用程序编写iOS FFI方法。在那里,我提出了一个清晰的backgroundcolor视图控制器。但是,它显示了一个白色背景视图。我没有使用storyboars,我只是在代码中设计视图。在newviewcontroller viewdidload中,我将self.view背景颜色设置为clearcolor。以清晰的背景呈现UIViewController

这是我已经试过了,

NewViewController *newVC = [[NewViewController alloc]init]; 
newVC.providesPresentationContextTransitionStyle = YES; 
newVC.definesPresentationContext = YES; 
self.modalPresentationStyle = UIModalPresentationCurrentContext; 
[KonyUIContext onCurrentFormControllerPresentModalViewController:newVC animated:YES]; 

我是新来KonyUIContext,我怎么能解决这个问题?

任何人都可以帮助我吗?

+0

您使用的故事板? –

+0

@BhavinRamani,不,我只在代码中设计视图。在newviewcontroller viewdidload中,我将self.view背景颜色设置为clearcolor – NAZIK

+0

好的。然后请使用以上评论编辑您的问题。 –

回答

1

试试这个代码...它完美对我....

MyViewController *modalViewController = [[MyViewController alloc] init]; 
modalViewController.modalPresentationStyle = UIModalPresentationOverCurrentContext;   
[KonyUIContext presentViewController:modalViewController animated:YES completion:nil]; 
+0

我使用KonyUIContext ..., – NAZIK

+0

而不是self.modalPresentationStyle,将newVC.modalPresentationStyle设置为UIModalPresentationOverCurrentContext, – NAZIK

0

试试这个,你只需要设置backgroundcolor来清除viewcontroller视图的颜色。

NewViewController *newVC = [[NewViewController alloc]init]; 
newVC.view.backgroundColor = [UIColor clearColor]; 
newVC.providesPresentationContextTransitionStyle = YES; 
newVC.definesPresentationContext = YES; 
self.modalPresentationStyle = UIModalPresentationCurrentContext; 
[KonyUIContext onCurrentFormControllerPresentModalViewController:newVC animated:YES]; 

希望能帮到你!

+0

它不工作:( – NAZIK