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>