动态添加控件,文字一部分没有显示出来,请帮忙看看
动态添加控件,文字部分没有显示出来,请帮忙看看!
我部分的代码:
界面代码:
我部分的代码:
ll_property=(LinearLayout)findViewById(R.id.ll_property);
ll_property.setOrientation(LinearLayout.VERTICAL);
for(int i=0;i<propertylist.size();i++)
{
arrproperty[i]=new CheckBox(this);
System.out.println(propertylist.get(i).getPname().toString());
arrproperty[i].setText(propertylist.get(i).getPname().toString());
ll_property.addView(arrproperty[i]);
}
界面代码:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="vertical"
android:fadingEdge="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_gravity="center|center_horizontal|center_vertical"
>
<LinearLayout
android:orientation="horizontal"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginTop="200sp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10sp"
android:textSize="16sp"
android:text="name:"
/>
<EditText
android:layout_width="200sp"
android:layout_height="wrap_content"
android:id="@+id/et_cheakout_add_goodsname"
android:focusable="false"
/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="fl:"
/>
<EditText
android:layout_width="200sp"