I am trying to set TextView width dynamically, Using setWidth(width)
method.
txtviewOne.setWidth(10);
txtviewTwo.setWidth(10);
But not success.
Please help me How can I set width of textview dynamically.
I am trying to set TextView width dynamically, Using setWidth(width)
method.
txtviewOne.setWidth(10);
txtviewTwo.setWidth(10);
But not success.
Please help me How can I set width of textview dynamically.
I have experienced something similar in situations where there is a ScrollView in the parents hierarchy. No matter how I would modify layout inside it, my commands were ignored. If this is the case, try calling RequestLayout on the ScrollView or remove and re-add the child view of the ScrollView.
I call
new TableRow()
, because textView's parent isTableRow
. If your parent's view isLinearLayout
, replace it bynew LinearLayout.LayoutParams
.