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

  • Home
  • SEARCH
  • 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 8547951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:22:54+00:00 2026-06-11T13:22:54+00:00

Is it possible for me to add text to a uiwebview and change the

  • 0

Is it possible for me to add text to a uiwebview and change the text and colours in this view without having separate html files? So I define whats in the html file in a switch statement? I do this at the moment using labels, but I can’t have more than one colour in a label so I need to use html, as core text looks quite complicated.

switch (counter)
{
    case 0:
        titleLabel.text = @"needs to be more than one colour";
      break;
    case 1:
        titleLabel.text = @"needs to be more than one colour";
        break;

and so on…

Can I in some way define whats in a html file in tags in the code in these switches rather than having seperate html files? If so how would I do this?

Cheers,

Lewis

  • 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-06-11T13:22:55+00:00Added an answer on June 11, 2026 at 1:22 pm

    Assuming your HTML contains a CSS class called myCssClass where you specify your colors, and a label:

    <label id="myTextElement">A Label</label>
    

    You can programmatically execute javascript to set a different CSS class using code like this:

    UIWebView *webView; 
    .
    .
    .
    [webView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"myTextElement\").className = \"myCssClass\";"];
    

    though honestly if you watch the WWDC 2012 videos on CoreText you might be less intimidated…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to add Clear when editing starts to a text view? This
Is it possible to add multiple lines of text as a detailTextLabel without making
Is it possible to add status text in jQuery progress bar? For example :
If i have made rectangle then it is possible to add any text inside/onto
Is it possible to extend the rich-text editor to add and other HTML5 elements?
Is it possible to add a table view on the cells of a table
Is it possible to add an Argument to an python argparse.ArgumentParser without it showing
Is it possible to add an image(view) on top of a button (which as
How can I add text or characters into a Sprite. If it's not possible,
Is it possible to add text to end of a PDF document created by

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.