1

Всем привет, не мог бы мне кто нибудь помочь? Дело в том, что я заменил Action Bar на Toolbar, и так вышло что появился белый зазор над Toolbar. В настройках телефона включил границы элементов, увидел, что там есть какой-то элемент. Что делать? введите сюда описание изображения

Main

<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:tools="http://schemas.android.com/tools"
    android:fitsSystemWindows="true"
    android:background="#dddddd"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar"
    tools:context=".MainActivity">
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:background="@color/colorPrimary"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
        />

        <TabHost
            android:id="@android:id/tabhost"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <TabWidget
                    android:id="@android:id/tabs"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:tabStripEnabled="true"
                    android:layout_marginTop="43dp">

                </TabWidget>

                <FrameLayout
                    android:id="@android:id/tabcontent"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <LinearLayout
                        android:id="@+id/tab1"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent">

                        <android.support.v7.widget.CardView
                            xmlns:card_view="http://schemas.android.com/apk/res-auto"
                            android:id="@+id/card_view"
                            android:layout_width="match_parent"
                            android:layout_height="60dp"
                            android:layout_gravity="top"
                            card_view:cardCornerRadius="6dp"
                            android:layout_marginLeft="12dp"
                            android:layout_marginRight="12dp">

                            <RelativeLayout
                                android:layout_height="wrap_content"
                                android:layout_width="wrap_content"
                                android:onClick="clicked">

                                <TextView
                                    android:id="@+id/info_text"
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:text="Что такое HTML?"
                                    android:gravity="start"
                                    android:textSize="14sp"
                                    android:paddingTop="12dp"
                                    android:paddingLeft="8dp"
                                    android:textColor="#000000"/>

                                <TextView
                                    android:id="@+id/info_text"
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:text="Разберёмся, что представляет из себя HTML."
                                    android:textSize="11sp"
                                    android:gravity="bottom|left"
                                    android:paddingBottom="12dp"
                                    android:paddingLeft="8dp"/>

                                <ImageButton
                                    android:id="@+id/html_lesson_1"
                                    android:background="@drawable/arrow_paddinged"
                                    android:layout_width="50dp"
                                    android:layout_height="match_parent"
                                    android:layout_alignParentRight="true"
                                    android:padding="15dp"/>

                            </RelativeLayout>

                        </android.support.v7.widget.CardView>

                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/tab2"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent">

                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/tab3"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent">

                    </LinearLayout>

                </FrameLayout>

            </LinearLayout>

        </TabHost>


    </RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
4
  • попробуйте для тулбара добавить минимальный размер по вертикали android:minHeight="?android:actionBarSize"
    – pavlofff
    14 ноя 2019 в 6:56
  • Я уже понял, в чём проблема. Проблема в сторонней библиотеке, которую я использую для nav drawer. Но всё равно спасибо за уделённое время. 14 ноя 2019 в 7:21
  • 1
    если вы самостоятельно нашли решение, оформите его, как ответ (кнопка "ответить на собственный вопрос"). это поможет другим участникам быстрее решить аналогичную проблему
    – pavlofff
    14 ноя 2019 в 10:06
  • @pavlofff спасибо за подсказку. Я здесь новичок и только учусь. 19 ноя 2019 в 16:27

1 ответ 1

1

Проблема решена! Дело в сторонней библиотеке com.mikepenz.materialdrawer, которую я использовал для создания Navigation Drawer. Библиотека имеет такую ошибку. Поэтому я удалил её из своего проекта.

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.