以清晰的背景呈现 UIViewController

Presenting UIViewController with clear background

我正在为 Kony 应用程序编写 iOS FFI 方法。在那里,我展示了一个具有清晰背景色的 viewcontroller。但是,它显示的是白色背景视图。我没有使用故事板,我只是在代码中设计视图。在新的 viewcontroller viewdidload 中,我将 self.view 背景颜色设置为 clearcolor。

这是我试过的,

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

我是 KonyUIContext 的新手,我该如何解决这个问题?

谁能帮我解决这个问题?

试试这个,您只需要设置 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];

希望对您有所帮助!

试试这个代码...它非常适合我....

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