Hi,
In my sample application I'm using a LinearLayout and not using the layout XML. I have defined an EditText but it spans the width of the layout and I want to make it much smaller. I've called setWidth but it had no effect. Can anyone help? Thanks!
Code;
EditText symbol;
protected
symbol.setMaxWidth(300);
layout.addView(symbol);
In my sample application I'm using a LinearLayout and not using the layout XML. I have defined an EditText but it spans the width of the layout and I want to make it much smaller. I've called setWidth but it had no effect. Can anyone help? Thanks!
Code;
EditText symbol;
protected
void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
symbol =new EditText(this);
super.onCreate(savedInstanceState);
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
symbol =new EditText(this);
symbol.setMaxWidth(300);
layout.addView(symbol);