Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6054591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:10:12+00:00 2026-05-23T08:10:12+00:00

I have save a string like this.. NSString *loadString = [NSString stringWithFormat:@<html><body><font color=\white\>%@</font></body></html>, string];

  • 0

I have save a string like this..

NSString *loadString = [NSString stringWithFormat:@"<html><body><font color=\"white\">%@</font></body></html>", string];

Now i want to load this string in a webview using

[webView loadHTMLString:loadString baseURL:nil];

now when the webpage is loaded the colour is default as black. I want to change the colour to white but m unable to do so. any suggestion how can i change the font colour.Thanks.

EDIT 1:
I tried this but no luck..

NSString *htmlString = [NSString stringWithFormat:@"<html><style type=\"text/css\"><!--.style1 { font-family: Arial;color: #FFFFFF;font-size: 20px;font-weight: bold;}--> <body><font class=\"style1\">%@</font></body></html>", string];

also this..

NSString *htmlString = [NSString stringWithFormat:@"<html> \n""<head> \n""<style type=\"text/css\"> \n""body {font-family: \"%@\"; font-size: %@; color:#FFFFFF; }\n""</style> \n""</head> \n""<body>%@</body> \n""</html>", @"helvetica", [NSNumber numberWithInt:15], string];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:10:13+00:00Added an answer on May 23, 2026 at 8:10 am

    Here is a full listing. Just create a view controller + NIB called “WebViewTestViewController” and add the webView in your nib file and connect it.

    WebViewTestViewController.h:

    #import <UIKit/UIKit.h>
    
    @interface WebViewTestViewController : UIViewController {
        UIWebView *webView;
    }
    @property (nonatomic, retain) IBOutlet UIWebView *webView;
    @end
    

    WebViewTestViewController.m:

    #import "WebViewTestViewController.h"
    
    @implementation WebViewTestViewController
    @synthesize webView;
    
    - (void)viewDidAppear:(BOOL)animated {
        NSString *string = @"Hello world";
        NSString *loadString = [NSString stringWithFormat:@"<html><head><style>body {background:blue} p {color:white;}</style></head><body><p>%@<p></body></html>", string];
        [webView loadHTMLString:loadString baseURL:nil];
    
        [super viewDidAppear:animated];
    }
    
    - (void)dealloc {
        [webView release];
        [super dealloc];
    }
    
    
    - (void)viewDidUnload {
        [self setWebView:nil];
        [super viewDidUnload];
    }
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: @10/04/2011 and I want to save only the
I have some code like this: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Save([Bind(Prefix=)]Person person) { String s
This should be really simple. If I have a String like this: ../Test?/sample*.txt then
I have a comment model with string property like this: [Column] public string Text
I have a string that looks like this H4sIALYnhUsCA9VXW5aDIAz9zypcgiU8dDnTWtfQ5Q8kEgSR ap05c+YnhxLyumBu2r/s2PUvO3nh+rCaw0oFob1Q+Z51HfjNZ1jexCSsLAYx BGG6eATZGJYALIIzG9QOy4NeaPYAyyarKfQY7TgypTjGI3ogkxDahSTw7kX/ FQUHeIgxsoClQD1JGRKF7Jy4oXNeQFou5TvJzlkJoAUIMuGAOlePMTEGWQry 2liLCfHNJPEwuiU7jmzEhM6gnGawSO3ORMnqLQRsNgki7AV4jEI9xKRU65V6 q7UUZVetqsZQC13z3UzMXkkM24nlvs+B/EktqmsnC0dxelvLycTaN+QugYw/
I have a newtype I'd like to save in a file, something like this:
I have some slow internet task to save and load file, I'd like to
I'm used to passing around string like this in my C++ applications: void foo(const
I have a simple class that provides state codes like this: public class StateProvider
I have a Service model with title:string description:string date:datetime. I would like to implement

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.