Nazik
Nazik

Reputation: 8444

Presenting UIViewController with clear background

I'm writing iOS FFI methods for Kony application. In that, I'm presenting a viewcontroller with clear backgroundcolor. But, it's showing a white background view. I'm not using storyboars, I'm designing views in code only. In the newviewcontroller viewdidload, I set the self.view background color to clearcolor.

Here's what I have tried,

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

I'm new to KonyUIContext, how can I fix this?

Can anyone help me on this?

Upvotes: 0

Views: 498

Answers (2)

user3600801
user3600801

Reputation:

Try this code... It works perfectly for me....

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

Upvotes: 1

saurabh goyal
saurabh goyal

Reputation: 438

try this , You just need to set backgroundcolor to clear color of your viewcontroller's view .

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

Hope this Helps!

Upvotes: 0

Related Questions