我试图动态设置TextView宽度,使用setWidth(width)方法.
- txtviewOne.setWidth(10);
- txtviewTwo.setWidth(10);
但不成功.
请帮帮我如何动态设置textview的宽度.
解决方法
- TextView tv;
- ----------------------
- tv=new TextView(this); // or tv=new TextView(R.id.textview1);
- LinearLayout.LayoutParams Params1 = new LinearLayout.LayoutParams(15,50);
- tv.setLayoutParams(Params1);