0

I know ShowcaseView can target one exact view, but I just want a semi-transparent demo screen without target anything, and I want to customize showcase's background. So I did this:

showcaseView=new ShowcaseView.Builder(this)
               // .setTarget(new ActionViewTarget(this, ActionViewTarget.Type.HOME))
                .setTarget(Target.NONE)
                .setStyle(R.style.Transparent)
                .setContentTitle("Check it out")
                .setContentText("You don't always need a target to showcase")
                .hideOnTouchOutside()
                .singleShot(42)
                .build();

And my R.style.Transparent like this:

<style name="Transparent" parent="android:Theme">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:background">@drawable/guide</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:backgroundDimEnabled">false</item>
</style>

But finally, only contentTitle and contentText were showed, my @drawable/guide was not showed!

How do i do to show my own background image, Thanks.

user1024
  • 982
  • 4
  • 13
  • 26

1 Answers1

0

You'll want to use the property sv_backgroundColor, rather than android:background. Unfortunately that does mean you can only use a colour, not a drawable.

You can see how to declare custom themes here: https://github.com/amlcurran/ShowcaseView/blob/master/sample/src/main/res/values/styles.xml

Alex Curran
  • 8,818
  • 6
  • 49
  • 55
  • `sv_backgroundColor` is good, but just as you said, if I can't use a drawable as my background image, how can I create a semi-transparent demo screen just like this ![](http://i.stack.imgur.com/P3kzh.png) – user1024 Oct 11 '14 at 01:56
  • If you would really like to do it, you could set sv_backgroundColor to transparent, and then manually `setBackground(Drawable)` on the ShowcaseView once created. It is a standard View, don't forget! – Alex Curran Oct 12 '14 at 17:13
  • Hi everyone, I have figure it out, like this: ![](https://raw.githubusercontent.com/Beeder/ShowcaseViewDemo/master/Screenshot.PNG) The minimal example code and introduction is here: [ShowcaseViewDemo](https://github.com/Beeder/ShowcaseViewDemo) – user1024 Nov 13 '14 at 03:57