Sabit kodlanmış html sayfası görüntülemesi gereken bir form sayfası istektir. Şimdi bir iki parça sorun ilk sorun var bunun işe yaradığını bu durumda <left>
için <CENTER>
etiketi değiştirebilirUIWebView IOS üzerinde html içeriği nasıl görüntülenir IOS
<CENTER><H1>A Simple Sample Web Page</H1><H4>By Frodo</H4>
<H2>Demonstrating a few HTML features</H2></CENTER>
gibi görüntülenir ama Seçeneklerimi sınırlar. Bu içeriği nasıl görüntüleyebilirim? Ekranın ortasında hizalama sorunları olmadan?
Sorunun ikinci kısmı, içeriğe nasıl bir renk veya bağlantı ekleyebilirim. hat ""FFFFFF">\n"
ben Expected ':'
ve on line hattının "<a href="http://somegreatsite.com">\n"
yarısı olan yeşil o
Benim tam kod gibidir XCode tarafından yürütülen anlamına gelir ekranda açıklama gibi görünüyor diyor hata alıyorum:
- (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="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];
}
Düzenleme :: Eklendi hikaye tahtası resim Yani
nasıl doğru alignm yapabilirsiniz renk/bağlantıyı doğru bir şekilde gömüp gömdürebilir misiniz? senin UIWebView
doğru boyutta olup olmadığını
webView = [[UIWebView ayırma] initWithFrame: self.view vermeyi deneyin. ** sınırlar **]; çerçeve yerine – Charan
Neden 'html' yerine [html description] ' ? – DAS
dizgeyi web görünümüne nasıl iletiyorsunuz? –