I have a UITextView where the user can create notes and save into a plist file.
I want to be able to show lines just like a normal notebook. The problem I have is
that the text won’t align properly.
The image below explains the problem quite well.

This is the background I use to create the lines like the Notes.app

This is my code for creating the background for my UITextView:
textView.font = [UIFont fontWithName:@"MarkerFelt-Thin" size:19.0];
textView.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @"Notes.png"]];
I know that the UIFont.lineHeight property is only available in > iOS 4.x.
So I wonder if there is another solution to my problem?
You should try and draw your lines programmatically rather than using an image. Here’s some sample code of how you could accomplish that. You can subclass
UITextViewand override it’sdrawRect:method.NoteView.h
NoteView.m
MyViewController.h
MyViewController.m
Take a look at Apple’s documentation for Managing the Keyboard, specifically “Moving Content That Is Located Under the Keyboard”. It explains how to listen for NSNotifcations and adjust your views properly.