我已经创建了这样的视图,所以我想通过两种数据绑定方式来绑定这些视图。 不要使用此代码 android:text =“ @ = {viewmodel.name}”
for(int i=0; i<5; i++){
TextInputLayout textInputLayout = new TextInputLayout(getActivity());
LinearLayout.LayoutParams layoutParams = new
LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
AppCompatEditText appCompatEditText =
new AppCompatEditText(getActivity());
extInputLayout.setHint("name");
appCompatEditText.setLayoutParams(layoutParams);
appCompatEditText.setHint("name");
appCompatEditText.setId("i");
}