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 9240485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:11:52+00:00 2026-06-18T08:11:52+00:00

I have a text view in which text is displayed like this: how are

  • 0

I have a text view in which text is displayed like this:

how are you?

Fine

Now if i set font for text view, then the same font is displayed for the two lines(ques and answer), however i want question to be displayed in one font and answer in some other font. How can i do this?

I set font like this:

textView = [[UITextView alloc]initWithFrame:CGRectMake(10, 80, 300, 440)];
textView.layer.borderColor = [UIColor blackColor].CGColor;
[textView setFont:[UIFont fontWithName:@"TimesNewRomanPS-ItalicMT" size:14]];
textView.layer.borderWidth = 1.0;
    textView.autoresizesSubviews = YES;
    textView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view addSubview:textView];

Thanks in advance!!

  • 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-18T08:11:53+00:00Added an answer on June 18, 2026 at 8:11 am

    From the UITextView class reference:

    In iOS 6 and later, this class supports multiple text styles through
    use of the attributedText property. (Styled text is not supported in
    earlier versions of iOS.) Setting a value for this property causes the
    text view to use the style information provided in the attributed
    string. You can still use the font, textColor, and textAlignment
    properties to set style attributes, but those properties apply to all
    of the text in the text view.

    This class does not support multiple styles for text. The font, color,
    and text alignment attributes you specify always apply to the entire
    contents of the text view. To display more complex styling in your
    application, you need to use a UIWebView object and render your
    content using HTML.

    So you cannot have two on the same page for iOS 5 or less because it is not supported. Just use a webview and an HTML file. for iOS6 maybe you can try using attributedText property of UITextView. This is available under iOS 6. Never tried it though.

    Or have 2 different UITextView’s (its ugly but thats what it is).

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

Sidebar

Related Questions

I want to implement this view But I have one question: The text which
Hi All, I have a web-view in my application which displays some text with
I have Text( http://www.mywebsite.com ) in a view, in which i need to provide
I have a custom component which consists of 2 text view and 4 toggle
I have a TextView which i set the text using setText(). In properties, I
In my application,i have text view with long text. i need text wrapping like
I have a text view. What I want is when I select the text
I need to have various text view on a single line. And I want
I have a WPF MVVM application which stores some text in a database (nvarchar).
I have a UIScrollView which contains a view controller which contains a couple of

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.