UIWebView contents are not showing

122 views Asked by At

I have a UIWebView on a UIView which loads content from server.

The UIWebView contents are not showing in screen.

What is wrong with my code?

vwWebView = [[UIView alloc]init];
vwWebView.frame=CGRectMake(10, 20, [GRAPHICS SCREEN_WIDTH]-40,[GRAPHICS SCREEN_HEIGHT]-20);
vwWebView.layer.borderWidth = 3.0;
vwWebView.layer.borderColor =  [[UIColor colorWithRed:207.0 / 255.0
                                                green:207.0 / 255.0
                                                 blue:207.0 / 255.0
                                                alpha:1.0] CGColor];
vwWebView.layer.cornerRadius = 3.0;
vwWebView.backgroundColor = [UIColor whiteColor];

m_webView = [[UIWebView alloc] init];
m_webView.autoresizesSubviews = YES;
m_webView.autoresizingMask = (UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
m_webView.opaque = NO;
m_webView.delegate = self;
m_webView.scrollView.scrollEnabled=YES;
m_webView.backgroundColor = [UIColor lightGrayColor];
[vwWebView addSubview:m_webView];

[self.view addSubview:vwWebView];

-(void)API_CALLBACK_TermsAndConditions:(NSDictionary *)responseDict
{
    NSString *strCondition = [[NSString alloc] initWithString:[responseDict objectForKey:@"msg"]];
    NSString *loadString=[NSString stringWithFormat:@"<html><body text=\"#FFA500\">%@</body></html>", strCondition];
    [m_webView loadHTMLString:loadString baseURL:nil];
}
0

There are 0 answers