Issue
I want to add a line on top of the navigation bar similar to what's in the image here (except this is not a navigation bar).
How should I go about doing this? Do I need to add a lineview?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@+id/tab_contents"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/bottom_nav"
android:layout_marginTop="0dp"
android:layout_marginBottom="0dp">
</ScrollView>
<LinearLayout
android:id="@+id/bottom_nav"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:orientation="horizontal">
<Button
android:id="@+id/nav_button1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
style="?android:attr/borderlessButtonStyle"
android:text="Home"/>
<Button
android:id="@+id/nav_button2"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
style="?android:attr/borderlessButtonStyle"
android:text="Search"/>
</LinearLayout>
</RelativeLayout>
Solution
Add a single view with a height of 1db or 2db and align it to the top of the Bottom View
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@+id/tab_contents"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/bottom_nav"
android:layout_marginTop="0dp"
android:layout_marginBottom="0dp"></ScrollView>
<LinearLayout
android:id="@+id/bottom_nav"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:orientation="horizontal">
<Button
android:id="@+id/nav_button1"
style="?android:attr/borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Home" />
<Button
android:id="@+id/nav_button2"
style="?android:attr/borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Search" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_alignTop="@+id/bottom_nav"
android:background="#C5C5C5" />
</RelativeLayout>
Answered By - Zain
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.