Android:TabLayout UI闪烁/闪烁问题

时间:2019-04-25 07:22:46

标签: android android-tablayout flicker

我有一个具有菜单和聊天屏幕的TabLayout,以前,该TabLayout在屏幕顶部对齐。我只是将“标签”布局更改为底部

进入聊天屏幕时TabLayout更改为底部(聊天屏幕编辑文本位于底部位置)后 UI闪烁

现在聊天编辑文本显示在TabLayout的上方,我不知道这与焦点问题有关

UI闪烁是否有任何原因?

布局

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:ignore="MissingPrefix">

<android.support.design.widget.AppBarLayout
    android:id="@+id/app_bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:background="@color/white"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    app:elevation="0dp">

    <android.support.v7.widget.Toolbar
        android:id="@+id/tb_toolbar_main_activity"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@android:color/transparent"
        app:layout_scrollFlags="enterAlways"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_vertical"
            android:orientation="horizontal">

            <TextView
                android:id="@+id/tb_heading"
                fontPath="@string/font_bebas_neue_bold"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginEnd="15dp"
                android:layout_marginRight="15dp"
                android:text="@string/app_name_caps"
                android:textAlignment="center"
                android:textColor="@color/heading_color"
                android:textSize="@dimen/toolbar_title_text" />

        </LinearLayout>
    </android.support.v7.widget.Toolbar>


</android.support.design.widget.AppBarLayout>


<android.support.design.widget.TabLayout
    android:id="@+id/tabs"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    app:tabBackground="@drawable/tab_back_selected"
    app:tabIndicatorHeight="0dp"
    app:tabMode="fixed"
    app:tabGravity="fill"
    app:tabSelectedTextColor="@android:color/white"
    app:tabTextAppearance="@style/MyTabLayoutTextAppearance"
    app:tabTextColor="@color/home_sub_text" />

<android.support.v4.view.ViewPager
    android:id="@+id/vp_activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    android:layout_below="@id/app_bar"
    android:layout_above="@id/tabs"/>

</RelativeLayout>

0 个答案:

没有答案