【发布时间】:2016-02-02 20:56:06
【问题描述】:
我有一个这样定义的 AppBarLayout
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
但是,有时我会更改应用程序的主题,并且我也想更改它及其子主题。通过这样做,我取得了部分成功:
AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.appbar_layout);
appBarLayout.getContext().setTheme(R.style.AppTheme_Dark_AppBarOverlay);
appBarLayout.invalidate();
但是,标题的 TextView 没有获取主题设置。
如何设置?
【问题讨论】:
标签: android styles themes android-appbarlayout