tags:

views:

32

answers:

1

I have a UITextView for which I want left/right/top/bottom content margins and the code I used is:

// Set the paddings
UIEdgeInsets aUIEdge = [aTextView contentInset]; 
aUIEdge.left = 15;
aUIEdge.right = 15;
aUIEdge.top = 10;
aUIEdge.bottom = 10;
aTextView.contentInset = aUIEdge;

But this gives me correct output in iPhone and not in iPad. What to do, give some clue?

A: 

It worked with a IF statement: // Set the paddings UIEdgeInsets aUIEdge = [aTextView contentInset]; if (<>) { aUIEdge.left = 15; aUIEdge.right = 10; } else { aUIEdge.left = 5; aUIEdge.right = 15; }

Abhinav