I manually built two counters on the action bar, first creating two menu items in the main.xml file. With string
cSpinner.setAdapter( ArrayAdapter.createFromResource( this,
R.array.category_data,
android.R.layout.simple_spinner_dropdown_item )
);
I set the Array resource for them. These things actually work, but the problem is that the resource line of the left rotator is so large that you can see only a small piece of the right counter.

I tried something like cSpinner.setLayoutParams(new Spinner.LayoutParams(60, 20));or '
ViewGroup.LayoutParams params = pView.getLayoutParams();
params.width = 100;
cspinner.setLayoutParams(params);
But none of them work. The second even allows the program to crash. Now you know the advice, how can I solve this problem?
source
share