ShowcaseView icon indicating copy to clipboard operation
ShowcaseView copied to clipboard

ShowcaseView not centered

Open MaxToyberman opened this issue 9 years ago • 1 comments

I have a strange error when exiting the app and reentering it ,the ShowcaseView is not centered,I use this code in a Fragment. This my code for :

target = new ViewTarget(iv_QR);
            if (showcase == null) {
                Button button = new Button(getContext());
                button.setText("Got it !");
                button.setEnabled(false);
                button.setVisibility(View.INVISIBLE);
                showcase = new ShowcaseView.Builder(getActivity())
                        .setStyle(R.style.CustomShowcaseTheme2)
                        .replaceEndButton(button)
                        .setTarget(target)
                        .withMaterialShowcase()
                        .setContentTitle("QR Scan(Required)")
                        .setContentText("Please press the QR icon to scan the QR")
                        .build();

and this is my xml :

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Fragments.QRFragment">


    <ImageView
        android:id="@+id/iv_QR"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:background="@mipmap/qricon" />
</RelativeLayout>

I am attaching an Image: icpog

MaxToyberman avatar Jun 21 '16 09:06 MaxToyberman

Add this to your showcase view object showcaseView.forceTextPosition(ShowcaseView.ABOVE_SHOWCASE);

drayan85 avatar Mar 14 '18 04:03 drayan85