Different behaviour on iPhone and iPad
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 c开发者_Go百科orrect output in iPhone and not in iPad. What to do, give some clue?
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; }
精彩评论