我正在使用带有以下代码的ShowcaseView ( https://github.com/amlcurran/ShowcaseView ):
ViewTarget target = new ViewTarget(R.id.targetButton, this);
ShowcaseView sv = new ShowcaseView.Builder(this, true)
.setTarget(target)
.setContentTitle("Hello world")
.setContentText("This is the important counter")
.setStyle(R.style.CustomShowcaseTheme2)
.setShowcaseEventListener(this)
.build();
和styles.xml:
<style name="CustomTitle2" parent="TextAppearance.ShowcaseView.Title">
<item name="android:textColor">#25467A</item>
</style>
<style name="CustomShowcaseTheme2" parent="ShowcaseView.Light">
<item name="sv_backgroundColor">#22B3E5FC</item>
<item name="sv_showcaseColor">#25467A</item>
<item name="sv_buttonText">Close</item>
<item name="sv_titleTextAppearance">@style/CustomTitle2</item>
</style>
除了覆盖层本身根本不透明之外,这似乎是有效的。这意味着您看不到它下面的任何内容(页面上除了展示柜之外的内容)。我尝试更改为不同的颜色(sv_backgroundColor)以及父级,但没有任何效果。
我正在使用最新版本(5.0)
有任何想法吗?
编辑
我的部分主题:
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/theme1_primary</item>
<item name="colorPrimaryDark">@color/theme1_primary_dark</item>
<item name="colorAccent">@color/theme1_accent</item>
<item name="android:textColorPrimary">@color/theme1_primary_text</item>
<item name="android:textColorSecondary">@color/theme1_secondary_text</item>
<item name="android:textColorPrimaryInverse">@color/theme1_primary_light</item>
<item name="android:textColorSecondaryInverse">@color/theme1_secondary_text</item>
<item name="colorDivider">@color/theme1_divider</item>
<item name="colorIcons">@color/theme1_icons</item>
<item name="styleToolbar">@style/theme1_toolbar</item>
<item name="styleToolbarMenu">@style/theme1_toolbar_menu</item>
<item name="android:background">@color/white</item>
</style>