How to show html message in the alert View in Xcode?


            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@”Sample Title”
                                                            message:@”\n\n\n\n\n\n\n\n\n\n\n\n”
                                                           delegate:self
                                                  cancelButtonTitle:@”Accept”
                                                  otherButtonTitles:@”Cancel”, nil];

 UIWebView *webView = [[[UIWebView alloc] initWithFrame:CGRectMake(10, 40, 264, 254)] autorelease];
            
            
 NSString *myHtml = [NSString stringWithFormat:
                                @”<html><head>”
                                “<style type=\”text/css\”>”
                                “body{“
                                “font-family: Calibri;”
                                “font-size: 18px;”
                                “a {color: #FFF;}”
                                “},</style>”
                                “</head><body><p><b><center>Sample Heading</center></b> paragraph text1<br> .</p></body></html>”];
            
            [alert addSubview:webView];
 
            [webView loadHTMLString:myHtml baseURL:nil];
         
            [alert show]

Advertisements

One thought on “How to show html message in the alert View in Xcode?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s