1
如何在RelativeLayout中添加LinearLayout,其中動態內容是從DB中的Relativelayout中加載的?我希望在頁面的最後加載按鈕。文本&圖像作爲來自數據庫的行數加載。如何在RelativeLayout中添加LinearLayout,其中動態內容是從DB中的Relativelayout中加載的?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:orientation="vertical" android:layout_height="wrap_content" android:id="@+id/rowLayout" android:background="@android:color/holo_orange_dark">
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content">
<ImageView android:id="@+id/profileImg"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="14px"
android:layout_marginRight="10px"
android:layout_marginTop="4px" android:layout_gravity="left"
android:src="@drawable/checkmark" >
</ImageView>
<TextView
android:id="@+id/origin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@+id/label"
android:textColor="@android:color/white"
android:layout_marginTop="20dp"
android:textSize="20dp" android:layout_alignParentRight="true">
</TextView>`</LinearLayout> <LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">`
<Button
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textColor="#ffffff" android:text="ADD POOL" android:layout_gravity="center|center_vertical"
android:background="#ff9b0c" android:onClick="serviceMessage" />
</LinearLayout> </RelativeLayout>
謝謝@Danh,它更改了按鈕可見的格式。我希望按鈕在頁面末尾顯示行時按下一次。 – prasoons
你可以使用ScrollView是ContentLayout的父項:) – DanhLoi