0
私のレイアウトに問題があります。私は、アクティビティのビューページャでタブバーレイアウトを実装しましたが、私は答えを探していましたが、私の問題はタブバーにはandroid:layout_alignParentBottom="true"
という要素があります。最初は表示されませんでした(下の画像) tab bar not showingアンドロイド:ナビゲーションバーでオーバーレイしない方法
を追加して、ナビゲーションバーに実際にオーバーレイしているかどうかを確認しました。 tab bar shows
誰かが私にこれを手伝ってもらえますか?私は自分の問題がスタイルにあると思う。ここ は私のスタイルです:
<style name="Base.Theme.MyCureTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimary</item>
<item name="colorAccent">@color/colorPrimary</item>
<item name="android:textColorPrimary">@color/font_darker_blue</item>
<item name="android:textColor">@color/font_gray</item>
</style><style name="MyCustomTabLayout" parent="Widget.Design.TabLayout">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:minHeight">?attr/actionBarSize</item>
<item name="tabIndicatorColor">@android:color/transparent</item>
</style>
<style name="ToolbarTheme" parent="Widget.AppCompat.Toolbar">
<item name="actionMenuTextColor">@color/white</item>
<item name="colorControlNormal">@color/white</item>
<item name="colorControlActivated">@color/white</item>
<item name="android:textColorPrimary">@color/white</item>
<item name="actionButtonStyle">@style/Widget.AppCompat.ActionButton</item>
<item name="selectableItemBackground">?android:selectableItemBackground</item>
<item name="selectableItemBackgroundBorderless">?android:selectableItemBackground</item>
<item name="colorControlHighlight">@color/colorPrimary</item>
</style>
<style name="ToolbarThemeDark"
parent="Widget.AppCompat.Toolbar">
<item name="actionMenuTextColor">@color/colorPrimary</item>
<item name="colorControlNormal">@color/font_gray</item>
</style>
EDITED:
のxml:
<RelativeLayout 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">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_above="@+id/tabs"
android:background="@color/font_gray"/>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:layout_height="?android:attr/actionBarSize"
android:background="@color/white"
android:layout_marginBottom="56dp"
app:tabGravity="center"/>
<com.mycurepatient.android.widgets.CustomViewPager
android:id="@+id/viewpager"
android:layout_above="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
を除去することによって、それを解決しました。 –
@krislarson added xml –
Hmmm ...明らかに間違っているとは見えません。あなたのCustomViewPagerは 'onMeasure()'や 'onLayout'をオーバーライドしていますか? –