Android 如何在应用程序启动时创建带有用户说明的覆盖屏幕

Android 如何在应用程序启动时创建带有用户说明的覆盖屏幕,android,Android,我正在开发一个android应用程序,我只想在应用程序第一次启动时创建一个覆盖屏幕。我在应用程序启动时使用一个片段作为主屏幕。 我想手动而不是通过showcase library执行此操作。如果我遵循您的问题,您应该使用RelativeLayout作为覆盖。并根据需要设置可见性 <RelativeLayout android:width="match_parent" android:height="match_parent"> <LinearLayout>

我正在开发一个android应用程序,我只想在应用程序第一次启动时创建一个覆盖屏幕。我在应用程序启动时使用一个片段作为主屏幕。
我想手动而不是通过showcase library执行此操作。

如果我遵循您的问题,您应该使用
RelativeLayout
作为覆盖。并根据需要设置可见性

<RelativeLayout
   android:width="match_parent"
   android:height="match_parent">

<LinearLayout>

// your main layout goes here

<LinearLayout>

<RelativeLayout
   android:id="@+id/overlay"
   android:width="match_parent"
   android:height="match_parent">
</RelativeLayout>

</RelativeLayout>

//你的主要布局在这里

如果我遵循您的问题than,您应该使用
RelativeLayout
作为覆盖。并根据需要设置可见性

<RelativeLayout
   android:width="match_parent"
   android:height="match_parent">

<LinearLayout>

// your main layout goes here

<LinearLayout>

<RelativeLayout
   android:id="@+id/overlay"
   android:width="match_parent"
   android:height="match_parent">
</RelativeLayout>

</RelativeLayout>

//你的主要布局在这里

如果我遵循您的问题than,您应该使用
RelativeLayout
作为覆盖。并根据需要设置可见性

<RelativeLayout
   android:width="match_parent"
   android:height="match_parent">

<LinearLayout>

// your main layout goes here

<LinearLayout>

<RelativeLayout
   android:id="@+id/overlay"
   android:width="match_parent"
   android:height="match_parent">
</RelativeLayout>

</RelativeLayout>

//你的主要布局在这里

如果我遵循您的问题than,您应该使用
RelativeLayout
作为覆盖。并根据需要设置可见性

<RelativeLayout
   android:width="match_parent"
   android:height="match_parent">

<LinearLayout>

// your main layout goes here

<LinearLayout>

<RelativeLayout
   android:id="@+id/overlay"
   android:width="match_parent"
   android:height="match_parent">
</RelativeLayout>

</RelativeLayout>

//你的主要布局在这里

使用以下库之一:

showcaseView示例:

Button closeButton = new Button(this);
        closeButton.setBackgroundColor(200);
        closeButton.setEnabled(false);

        showcaseView = new ShowcaseView.Builder(this)
                .setTarget(new PointTarget(330, 570))
//                .setTarget(new ViewTarget(((Toolbar) findViewById(R.id.toolbar)).getChildAt(0)))//works
                .setContentTitle("Add a new device")
                .setContentText("You need to add a new device to be able to use this app")
//                .hideOnTouchOutside()
                .setStyle(R.style.CustomShowcaseTheme2)
                .replaceEndButton(closeButton)
                .build();

使用以下库之一:

showcaseView示例:

Button closeButton = new Button(this);
        closeButton.setBackgroundColor(200);
        closeButton.setEnabled(false);

        showcaseView = new ShowcaseView.Builder(this)
                .setTarget(new PointTarget(330, 570))
//                .setTarget(new ViewTarget(((Toolbar) findViewById(R.id.toolbar)).getChildAt(0)))//works
                .setContentTitle("Add a new device")
                .setContentText("You need to add a new device to be able to use this app")
//                .hideOnTouchOutside()
                .setStyle(R.style.CustomShowcaseTheme2)
                .replaceEndButton(closeButton)
                .build();

使用以下库之一:

showcaseView示例:

Button closeButton = new Button(this);
        closeButton.setBackgroundColor(200);
        closeButton.setEnabled(false);

        showcaseView = new ShowcaseView.Builder(this)
                .setTarget(new PointTarget(330, 570))
//                .setTarget(new ViewTarget(((Toolbar) findViewById(R.id.toolbar)).getChildAt(0)))//works
                .setContentTitle("Add a new device")
                .setContentText("You need to add a new device to be able to use this app")
//                .hideOnTouchOutside()
                .setStyle(R.style.CustomShowcaseTheme2)
                .replaceEndButton(closeButton)
                .build();

使用以下库之一:

showcaseView示例:

Button closeButton = new Button(this);
        closeButton.setBackgroundColor(200);
        closeButton.setEnabled(false);

        showcaseView = new ShowcaseView.Builder(this)
                .setTarget(new PointTarget(330, 570))
//                .setTarget(new ViewTarget(((Toolbar) findViewById(R.id.toolbar)).getChildAt(0)))//works
                .setContentTitle("Add a new device")
                .setContentText("You need to add a new device to be able to use this app")
//                .hideOnTouchOutside()
                .setStyle(R.style.CustomShowcaseTheme2)
                .replaceEndButton(closeButton)
                .build();

使用时应使用具有匹配父级高度和宽度的相对布局..>>第一次运行时使其可见>>根据需要设置为可见。我们应该使用具有匹配父级高度和宽度的相对布局。>>第一次运行时使其可见>>根据需要设置为可见。我们应该使用具有匹配父级高度和宽度的相对布局。>>第一次运行时使其可见>>根据需要设置为可见。我们应该使用具有匹配父级高度和宽度的相对布局。>>第一次运行时使其可见>>设置为在运行时可见want@DevKumar…向上投票并接受答案是对StackOverFlow表示感谢的方式。@Dev Kumar…向上投票并接受答案是对StackOverFlow表示感谢的方式。@Dev Kumar…向上投票并接受答案是对StackOverFlow表示感谢的方式。@Dev Kumar…向上投票并接受答案。@Dev Kumar…向上投票并接受答案接受答案是对StackOverFlow表示感谢的方式。