android - How to keep a View on top of my Fragments -
sounds question answered before research couldn't find solution. layout following:
the main area container i'll add/replace fragments, , bottom place bottom navigation menu. pink view button need place on top of menu (and that's not working).
every time add fragment main view, "menu" text disappears, though textview added after container view. same pink button, added after bottom menu container (see xml below).
how can keep both "menu" textview , pink button on top of fragments?
this xml:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#eee" tools:context="com.wecancer.wecancer.activities.menu"> <framelayout android:id="@+id/main_container_view" android:layout_width="match_parent" android:layout_height="520dp" android:layout_marginbottom="0dp" > </framelayout> <textview android:id="@+id/main_center_tv" android:layout_centervertical="true" android:textsize="24sp" android:layout_centerhorizontal="true" android:text="@string/menu" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <framelayout android:layout_alignparentbottom="true" android:id="@+id/main_bottom_menu_container" android:layout_width="match_parent" android:background="@color/lightgray" android:layout_height="40dp" > </framelayout> <button android:elevation="1dp" android:id="@+id/menu_plus_img" android:layout_centerhorizontal="true" android:layout_alignparentbottom="true" android:background="@color/coloraccent" android:layout_width="70dp" android:layout_marginbottom="0dp" android:layout_height="70dp" tools:targetapi="lollipop" /> </relativelayout>
try this`
<framelayout android:layout_alignparentbottom="true" android:id="@+id/main_bottom_menu_container" android:layout_width="match_parent" android:background="@color/colorprimary" android:layout_height="40dp" > </framelayout> <button android:elevation="1dp" android:id="@+id/menu_plus_img" android:background="@color/coloraccent" android:layout_width="70dp" android:layout_height="70dp" tools:targetapi="lollipop" android:layout_marginleft="71dp" android:layout_marginstart="71dp" android:layout_alignparenttop="true" android:layout_alignparentleft="true" android:layout_alignparentstart="true" /> <textview android:id="@+id/main_center_tv" android:textsize="24sp" android:text="@string/menu" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="16dp" android:layout_marginstart="16dp" android:layout_alignbaseline="@+id/menu_plus_img" android:layout_alignbottom="@+id/menu_plus_img" android:layout_torightof="@+id/menu_plus_img" android:layout_toendof="@+id/menu_plus_img" /> <framelayout android:id="@+id/main_container_view" android:layout_width="match_parent" android:layout_height="520dp" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_below="@+id/menu_plus_img"> </framelayout>
`
Comments
Post a Comment