我正在动态地向适配器添加视图,当视图超过屏幕边界时,我无法看到完整视图。
我试过了,没有任何运气。android:isScrollContainer="true"
android:scrollbars="vertical"
public void onAddField(View v) { final LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); final View rowView = inflater.inflate(R.layout.field, null); spin = rowView.findViewById(R.id.type_spinner2); weightLayout = rowView.findViewById(R.id.myLayout); getdata(); spin.setAdapter(new ArrayAdapter<String>(MainActivity.this, android.R.layout.simple_spinner_dropdown_item, arrayList2)); parentLinearLayout.addView(rowView, parentLinearLayout.getChildCount() - 1);
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:background="#E5E5E5" android:orientation="vertical" android:scrollbars="vertical" android:isScrollContainer="true">
牛魔王的故事
相关分类