简体   繁体   中英

space under bottom navigation bar

I dont have much knowledge of Android studio IDE, but i was asked to fix this problem, i thought there was a margin under the navigation bar but i cant identify the problem.

在此处输入图片说明

Endless CODE

<TextView android:layout_gravity="center_horizontal"
        android:ellipsize="end"
        android:singleLine="true"
        android:height="15px"
        android:gravity="center"
        android:layout_alignParentBottom="true"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        android:layout_marginBottom="55dip"
        android:id="@+id/Tab.Title" android:text="@+id/Tab.Title"
        style="@style/Tab.Title" />


    <LinearLayout android:id="@+id/BottomBarLayout"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:background="@drawable/tb_background_bottom" android:scaleType="fitXY"
        android:layout_alignParentBottom="true" android:weightSum="0"
       >

        <ImageButton android:layout_height="wrap_content"
            android:id="@+id/PreviousBtn" android:layout_width="wrap_content"
            android:background="@drawable/buttons_bottom"
            android:src="@drawable/ic_btn_next" android:layout_weight="1">
            </ImageButton>

        <ImageButton android:layout_height="wrap_content"
            android:id="@+id/NewTabBtn" android:layout_width="wrap_content"
            android:background="@drawable/buttons_bottom"
            android:src="@drawable/ic_btn_home" android:layout_weight="1"></ImageButton>


    </LinearLayout>

Well I am assuming that either you want to shift the navigation bar to bottom most position or you want to make the background matter view shorter so that the navigation bar is the lowermost element on the screen.

You need to make use of android:layout_marginBottom="-5dp" for the linear layout .

You don't need to necessarily use android:layout_alignParentBottom="true" as the margin settings will override those alignments.

We can adjust the margins as per the view requirement. Try different margin values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM