How to increase the height of EditText through cod

2019-07-26 08:22发布

I am trying to make the editText with increased height through android java code. How to achieve it? Any help is highly appreciated and thanks in advance....

2条回答
Ridiculous、
2楼-- · 2019-07-26 09:18

have you tried

editTextObject.setHeight(30);
查看更多
干净又极端
3楼-- · 2019-07-26 09:22

try this code...

ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams)EditText.getLayoutParams();
mlp.height=100;
mlp.width=150; 

where EditText is your EditText..

and you can also set Width , margin..etc

查看更多
登录 后发表回答