I tried to dynamically change the width of a spinner with the code below, but I get an error message. What is the correct way to do this?
Spinner s1 = (Spinner) findViewById(R.id.s1_10);
s1.setLayoutParams(new LayoutParams(400, LayoutParams.WRAP_CONTENT));
Do something like the following, i know it looks ugly, but this seems like the only way at the moment.
ViewGroup.LayoutParams params = mSomeView.getLayoutParams();
params.width += 10;
s1.setLayoutParams(params);