I've been making a tabbed activity with a list view in it. I've been trying to put a button under the list view, but when i run on my phone, the button doesn't show up.
My Fragment layout
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.siscaproject.sisca.Fragment.RegisterFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorRedPrimary"
android:padding="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="@string/item_detected"
android:textColor="#fff" />
<TextView
android:id="@+id/tv_total_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="7dp"
android:hint="10 items detected"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_data"
android:layout_below="@id/rl_total_data"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="@color/colorRedPrimary"
android:text="@string/register_all_item"
android:textAllCaps="false"
android:textColor="#fff" />
</RelativeLayout>
</FrameLayout>
My layout preview in my android studio
The layout when i run it on my phone (I'm using an Asus Zenfone 5)
I'm not sure where i did wrong, i actually have change the button into the floating button, but only half of the button shows in the layout. (Plus i can't scroll the layout)
Update I have resolved it, the problem is in the tabbed activity layout. I use a constraint layout as the parent, i've changed it to Relative layout and it works perfectly