How to set font style for table cell (navigation based application) on iphone

Please help me. How to set up different font styles (stylish sentences in a table cell) programmatically for a table lookup cell?

+6
source share
5 answers

You can follow this guide to add custom fonts to your application.

Adding custom font on iphone

Then you can call this code to set the font and font size

cell.textLabel.font = [UIFont fontWithName:@"custom" size:12.0f] 
+15
source

You can install it using UIFont, see this code -

 cell.textLabel.textColor=[UIColor whiteColor]; cell.textLabel.font=[UIFont fontWithName:@"Arial Rounded MT Bold" size:15.0]; cell.textLabel.numberOfLines=2; cell.textLabel.lineBreakMode=UILineBreakModeMiddleTruncation; cell.textLabel.backgroundColor=[UIColor clearColor]; 

There are many UITableViewCell properties that change its appearance. You can also set UILabel to a UITableViewCell as follows:

 [cell.contentView addSubview:lblView]; //lblView is your UILabel you can set its UIFont whatever you want 

Thanks!

+8
source

If you use the standard UITableViewCell , there is a " textLabel " in which you can access and set the font and size (which you would do using the UILabel font property).

+2
source

Starting with iOS 4, you can use custom fonts. This post shows how to include them in your project and how to install them in your submissions: http://blog.beefyapps.com/2010/06/custom-fonts-in-ios-4/

0
source

you can add a font as follows

  cell.textLabel.font = [UIFont fontWithName:@"Arail" size:12.0f]; 

OR

Give the font name as you want

  cell.textLabel.font = [UIFont fontWithName:@"yourFontNameHere" size:12.0f]; 
0
source

Source: https://habr.com/ru/post/917669/


All Articles