如何在带有类 java 而不是 xml 这段代码的 android 中添加滚动条或滚动视图?
LayoutInflater inflater = (LayoutInflater) getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.srvr, null);
layout = (RelativeLayout) view.findViewById(R.id.relativeLayout1);
RelativeLayout.LayoutParams labelLayoutParams = new RelativeLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
layout.setLayoutParams(labelLayoutParams);
labelLayoutParams = new RelativeLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
labelLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
labelLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
labelLayoutParams.leftMargin=120;
final EditText tt = new EditText(this);
tt.setTag(i);
tt.setText(DisplayName_list[i].toString());
tt.setMinWidth(230);
tt.setMaxWidth(230);
tt.setMaxLines(1);