首页 > 解决方案 > 如何在对话框顶部显示展示视图?

问题描述

我目前正在使用 faruktoptas 的名为 FancyShowCaseView 的展示视图,但如果它解决了这个问题,我愿意使用任何其他的。

问题是我有一个对话框片段,我想在其上使用展示视图,但它们总是出现在对话框下方。

我在对话框片段代码中编写了展示视图,如下所示:

public class MyDialog extends AppCompatDialogFragment {

    public Dialog onCreateDialog(Bundle savedInstanceState) {

        LayoutInflater inflater = getActivity().getLayoutInflater();
        View view = inflater.inflate(R.layout.layout_dialog, null);

        new FancyShowCaseView.Builder(getActivity())
                                .focusOn( view.findviewbyid(R.id.somebutton) )
                                .title("This button does this and that")
                                .backgroundColor(R.color.white)
                                .build()
                                .show();
    }
}

标签: javaandroid

解决方案


推荐阅读