开发者

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; }

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜