我有一个UITextView,我想要左/右/上/下内容边距,我使用的代码是:
// Set the paddings
UIEdgeInsets aUIEdge = [aTextView contentInset];
aUIEdge.left = 15;
aUIEdge.right = 15;
aUIEdge.top = 10;
aUIEdge.bottom = 10;
aTextView.contentInset = aUIEdge;
但是这给了我正确的iPhone输出而不是iPad。该怎么做,给一些线索?
答案 0 :(得分:0)
它与IF声明一起使用: //设置填充 UIEdgeInsets aUIEdge = [aTextView contentInset]; if(<>){ aUIEdge.left = 15; aUIEdge.right = 10; } 其他{ aUIEdge.left = 5; aUIEdge.right = 15; }