RonaldMcdonald
New Member
I have a form sheet segue that should display hard-coded html page.Now I have a two part problem first problem is \[code\] <CENTER><H1>A Simple Sample Web Page</H1><H4>By Frodo</H4><H2>Demonstrating a few HTML features</H2></CENTER>\[/code\]is displayed like
I can change \[code\]<CENTER>\[/code\]tag to \[code\]<left>\[/code\] in that case it works but it limits my options. How can I display this content In the middle of the screen without alignment issues? Second part of the question is How can I embed a color or a link to content. On line \[code\]""FFFFFF">\n"\[/code\] I get the error that says \[code\]Expected ':'\[/code\] and on line \[code\]"<a href="http://somegreatsite.com">\n"\[/code\] Half of the line is green which is seems like comment on the screen that means it will not executed by XCodeMy full code is like :\[code\]- (void) createWebViewWithHTML{ //create the string NSMutableString *html = [NSMutableString stringWithString: @"<html><head><title></title></head><body style=\"background:transparent;\">"]; //continue building the string [html appendString"<BODY BGCOLOR=" ""FFFFFF">\n" "<CENTER><IMG SRC="http://stackoverflow.com/questions/12784426/clouds.jpg" ALIGN="BOTTOM"> "</CENTER> \n" "<HR>\n" "<a href="http://somegreatsite.com">\n" "Link Name</a>\n" "is a link to another nifty site\n" "<H1>This is a Header</H1>\n" "<H2>This is a Medium Header</H2>\n" "Send me mail at <a href="mailto:[email protected]">\n" "[email protected]</a>.\n" "<P> This is a new paragraph!\n" "<P> <B>This is a new paragraph!</B>\n" "<BR> <B><I>This is a new sentence without a paragraph break, in bold italics.</I></B>\n" "<HR>\n"]; [html appendString"</body></html>"]; //instantiate the web view webView = [[UIWebView alloc] initWithFrame:self.view.frame]; //make the background transparent [webView setBackgroundColor:[UIColor clearColor]]; //pass the string to the webview [webView loadHTMLString:[html description] baseURL:nil]; //add it to the subview [self.view addSubview:webView];} \[/code\]Edit::Added story board picture
So how can I make correct alignment and embed color/link correctly?