How to increase the height of EditText through code in java?

て烟熏妆下的殇ゞ 提交于 2019-12-24 11:04:47

问题


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....


回答1:


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




回答2:


have you tried

editTextObject.setHeight(30);


来源:https://stackoverflow.com/questions/7480337/how-to-increase-the-height-of-edittext-through-code-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!