我正在创建一个带有标题“帐户信息”的布局的页面(参考图像)。后跟一个表格,我需要在从服务器获取后动态填充表格,但无法这样做。下面是 .xml 文件并附上图片:
<LinearLayout
android:id="@+id/header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@layout/header_gradient" >
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:layout_weight="0.20"
android:gravity="center_horizontal"
android:padding="15dp"
android:text="@string/my_account_header_text"
android:textColor="#ffffff"
android:textSize="24sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#ffffff" >
<RelativeLayout
android:id="@+id/my_activity_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#ffffff" >
<TextView
android:id="@+id/my_acc_component"
android:layout_width="158dp"
android:layout_height="wrap_content"
android:text="@string/my_account_component"
android:textColor="#372c24"
android:textSize="@dimen/login_credentials_txt" />
<TextView
android:id="@+id/my_acc_details"
android:layout_width="158dp"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/my_acc_component"
android:text="@string/my_account_details"
android:textColor="#372c24"
android:textSize="@dimen/login_credentials_txt" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>