Share on Google+Share on Google+

Java Coder
What is NSAttributedString
2 Answer(s)      5 years and 10 months ago
Posted in : MobileApplications

Please explain the NSAttributedString in Objective C and also give an example. Thanks.

Ads

View Answers

June 11, 2011 at 12:02 PM


NSMutableAttributedString* attrStr = [NSMutableAttributedString attributedStringWithString:@"Hello World!"];

[attrStr setFont:[UIFont systemFontOfSize:12]];

[attrStr setTextColor:[UIColor grayColor]];

[attrStr setTextColor:[UIColor redColor] range:NSMakeRange(0,5)];

myAttributedLabel.attributedText = attrStr;

myAttributedLabel.textAlignment = UITextAlignmentJustify;


June 11, 2011 at 12:03 PM


NSMutableAttributedString Example










Related Tutorials/Questions & Answers:
What is NSAttributedString
What is NSAttributedString  Please explain the NSAttributedString in Objective C and also give an example. Thanks.   NSMutableAttributedString* attrStr = [NSMutableAttributedString attributedStringWithString:@"Hello
what is bit
what is bit  what is bit
Advertisements
What is procedure
What is procedure  What is procedure in computers? What are the primary categories of procedures
what are indices?
what are indices?  what are indices
what is collections?
what is collections?  what is collections
What is this keyword?
What is this keyword?  What is this keyword
what is Savepoint ?
what is Savepoint ?  what is Savepoint
What is a "constraint"?
What is a "constraint"?  What is a "constraint
What is Index?
What is Index?  What is Index
What is SQLLoader?
What is SQLLoader?  What is SQLLoader
What is DML?
What is DML?  What is DML
What is an interface?
What is an interface?  What is an interface
What's PHP ?
What's PHP ?  What's PHP
What is VLR ?
What is VLR ?  hii, What is VLR
What is Trigger?
What is Trigger?  What is Trigger
What is ActionServlet?
What is ActionServlet?  What is ActionServlet
What is FBT
What is FBT   hello, What is FBT
What is JDBC?
What is JDBC?  What is JDBC
What is an Abstract Class and what is it's purpose?
What is an Abstract Class and what is it's purpose?   Hi, What is an Abstract Class and what is it's purpose? Thanks
What is a transaction and what are ACID properties?
What is a transaction and what are ACID properties?  What is a transaction and what are ACID properties
What is DataAccessException?
What is DataAccessException?  Hi, What is DataAccessException? thanks
What is IOC ?
What is IOC ?  HI, What is IOC or Dependency Injection? Thanks
What is SQLExceptionTranslator?
What is SQLExceptionTranslator?  Hi, What is SQLExceptionTranslator? Thanks
What is Externalizable?
What is Externalizable?   Hi, What is Externalizable? Thanks
What is the % operator?
What is the % operator?   Hi, What is the % operator? thanks
What is casting?
What is casting?   Hi, What is casting? thanks
What are Struts?
What are Struts?  What are Struts? Can anyone explain me what are the Struts framework and what are its uses? Thanks
What is WAP?
What is WAP?  What is WAP?   Hi, Check the tutorial: What is WAP? Thanks
What is CRM?
What is CRM?  Can anyone tell me What is CRM? Thanks
what is RUP?
what is RUP?  hello, what is RUP??   hii, RUP is stands for Rational Unified Process
What is a tuple?
What is a tuple?  What is a tuple?   hi, A tuple is an instance of data within a relational database. Thanks
Tutorials   
Java Spring Hibernate Struts Training How to uninstall old version of Android Studio? How to install cocoapods in Max? item lookup How to get path of a file in iOS? [NSConcreteMutableData release]: message sent to deallocated instance Covert Bool to String - NSString Getting UIButton by Tag How to write Example code for comparing Strings in iPhone SDK? How to set placeholder in uitextfield programmatically? Example code of adding placeholder in UItextFeild how to get UIView by tag J2me image use ase smiley UILineBreakModeWordWrap is deprecated Framework for Mobile Applications How to print UIButton id System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h' has been modified since the precompiled header UINavigationController Navigating to back uinavigationcontroller add right button UINavigationController how to set title uitextfield hide keyboard on return dismissmodalviewcontrolleranimated first deprecated in ios 6.0 xcode 6.1.1 download How to remove virtual keypad from apps java How to remove virtual keypad from apps java How to remove virtual keypad from apps java code to send sms alerts using jsp online iphone app development how to devlop mobile application? What is WAP? download mp3 file on server in iphone home button macbook pro keyboard calling from iphone through programitically in iphone How to retrieve a field from SQLite to Edittext in android How to retrieve a field from SQLite to Edittext in android Sqlite3 Why NSMutableDictionary ios work with nsdictionary what is class methods in objective c what is class methods in objective c UIButton HOW TO FIND OUT GPS COORDINATES WITHOUT USING ONLINE DATABASE OR OTHERTHING ON MOBILE HOW TO FIND OUT GPS COORDINATES WITHOUT USING ONLINE DATABASE OR OTHERTHING ON MOBILE HOW TO FIND OUT GPS COORDINATES WITHOUT USING ONLINE DATABASE OR OTHERTHING ON MOBILE Rad Calculator ANDROID J2ME Bar graph j2me image application iphone iphone

Ads

 
Advertisement null

Ads