我的巨型旋转器: http://i.stack.imgur.com/zNxdX.jpg
从图片中可以看出,我的旋转器太大了。我似乎找不到问题所在。 以下是代码:
RelativeLayout.LayoutParams lpSpinner = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
spTest = new Spinner(this);
String[] spinnerArray={"1","2","3","4","5","6","7","8","9","10"};
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, spinnerArray);
spTest.setAdapter(spinnerArrayAdapter);
spTest.setId(4);
lpSpinner.addRule(RelativeLayout.ALIGN_RIGHT, lblText.getId());
relative.addView(spTest, lpSpinner);
我做错了什么?