내가 뭘하고 있는가하는 것은 내가 Toolbar
, StatusBar
하고 실용적으로 기본 theme
색상, 내가 성공적으로 모든 widgets
의 색상을 변경할 수 있어요하지만 몇 가지 유형을 얻는 이외의 Tablayout
색상을 변경하는 것을 시도하고있다 Tablayout
에서 앱 테마의 기본 색상의 경계를 알 수없는 이유는 무엇입니까? 아무도 그것을 제거하는 방법을 말해 줄 수 있습니까? 기본 스타일은 Tablayout
의 모서리가 직사각형이 아니므로 정의됩니다.안드로이드 프로그래밍 TabLayout 배경을 변경하는 방법
화면 :
XML :
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
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:id="@+id/app_bar_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".mainFlow.MainActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="fill"
android:background="@color/colorPrimaryDark"
app:tabIndicatorHeight="2dp"
app:tabMode="fixed"
app:tabIndicatorColor="@color/white"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>
사용'응용 프로그램 : tabBackground는 = "@ 드로어 블/colorPrimaryDark " ' – Wizard
@Wizard 배경색을 프로그래밍 방식으로 변경하고 싶습니다 –