【发布时间】:2018-11-29 19:59:52
【问题描述】:
我是初学者 Android 程序员。我创建了一个 TabView,当按下选项卡项目中的任何项目时,颜色应该是灰色的,但它会变成蓝色。以前,我在导航底部菜单中遇到了这个问题。我糊涂了。问题出在哪里?我在最后放了两张截图来解释我想要什么以及发生了什么。
这是我的布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.v4.view.ViewPager
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_above="@id/tabs"
android:layout_alignParentTop="true" />
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<android.support.design.widget.TabItem
android:id="@+id/tabItem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ثبت نقدی" />
<android.support.design.widget.TabItem
android:id="@+id/tabItem2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="پیامک بانکی" />
<android.support.design.widget.TabItem
android:id="@+id/tabItem3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="نمودار" />
<android.support.design.widget.TabItem
android:id="@+id/tabItem4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="بیشتر" />
</android.support.design.widget.TabLayout>
</RelativeLayout>
在下面的图片中,按下 پیامک بانکی 按钮。
这就是我想要的:
这是我的问题。我不知道蓝色是从哪里来的。
【问题讨论】: