Appintro灰色图层在前面

时间:2017-01-10 09:48:14

标签: android

当我将Appintro添加到我的应用程序中作为其指导。 我的应用程序运行成功。但我的片段前面有灰色层。 如何删除它?我的活动是这样的:

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addSlide(new Slide_First());
     addSlide(new Slide_Second());
     addSlide(new Slide_Third());
     addSlide(new Slide_Forth());
    showSkipButton(true);
    setProgressButtonEnabled(false);

}

@Override
public void onSkipPressed(Fragment currentFragment) {
    super.onSkipPressed(currentFragment);
    // Do something when users tap on Skip button.
}

@Override
public void onDonePressed(Fragment currentFragment) {
    super.onDonePressed(currentFragment);
    // Do something when users tap on Done button.
    finish();
}

@Override
public void onSlideChanged(@Nullable Fragment oldFragment, @Nullable Fragment newFragment) {
    super.onSlideChanged(oldFragment, newFragment);
    // Do something when the slide changes.
}

enter image description here

1 个答案:

答案 0 :(得分:1)

看起来问题可能只是您的片段的创建方式。请尝试更改以下语句:

 addSlide(new Slide_First());
 addSlide(new Slide_Second());
 addSlide(new Slide_Third());
 addSlide(new Slide_Forth());

对于这些:

    addSlide(BaseSlide.newInstance(R.layout.slide_1));
    addSlide(BaseSlide.newInstance(R.layout.slide_2));
    addSlide(BaseSlide.newInstance(R.layout.slide_3));

第一个参数将用于Fragments,第二个参数将是对XML布局文件的调用。在BaseSlide.java中,不要忘记添加库中提供的this code