
- iOS Tutorial
- iOS - Home
- iOS - Getting Started
- iOS - Environment Setup
- iOS - Objective-C Basics
- iOS - First iPhone Application
- iOS - Actions and Outlets
- iOS - Delegates
- iOS - UI Elements
- iOS - Accelerometer
- iOS - Universal Applications
- iOS - Camera Management
- iOS - Location Handling
- iOS - SQLite Database
- iOS - Sending Email
- iOS - Audio & Video
- iOS - File Handling
- iOS - Accessing Maps
- iOS - In-App Purchase
- iOS - iAd Integration
- iOS - GameKit
- iOS - Storyboards
- iOS - Auto Layouts
- iOS - Twitter & Facebook
- iOS - Memory Management
- iOS - Application Debugging
- iOS Useful Resources
- iOS - Quick Guide
- iOS - Useful Resources
- iOS - Discussion
How to change the font and color on the UITextView in iOS?
Changing font and color on UITextView is simple, you just need to update the .textColor and .font property on UITextView object, Here we will be seeing how to do so.
So let’s get started,
Open Main.storyboard and add UITextView as shown below,
Create @IBOutlet of UITextView and name it, textView. @IBOutlet var textView: UITextView!
In your viewDidLoad method of ViewController.swift write below lines,
textView.textColor = UIColor.cyan textView.font = UIFont(name: "Callout", size: 20)
Final Code should look like,
import UIKit class ViewController: UIViewController { @IBOutlet var textView: UITextView! override func viewDidLoad() { super.viewDidLoad() textView.textColor = UIColor.cyan textView.font = UIFont(name: "Callout", size: 20)
Run the app,
- Related Articles
- How to change background color of TableView items on iOS?
- How to change the background color of the font in PowerShell?
- How can I change the text color of the Navigation Bar on iOS?
- How to change color and font of Android ListView?
- How to change the color and font of Android ListView using Kotlin?
- How to change the Foreground color or Font color of the console using PowerShell?
- How to change font color of textView in android?
- How to change the text color of font in the legend using Matplotlib?
- How do you animate the change of background color of a view on iOS?
- How to change the font color of a text using JavaScript?
- How to change the font on ttk.Entry in Tkinter?
- How to change the color and font of the tick marks in a JavaFX XY chart?
- How to change chart axis labels' font color and size in Excel?
- How do you change the default font color for all text in Matplotlib?
- Change Color of Button in iOS when Clicked

Advertisements