如何在Activity上创建一个透明的DialogFragment

时间:2017-07-06 02:30:19

标签: android

我有一个来自Activity的基本DialogFragment,我需要让它透明,所以我在样式上放了一个STYLE_NO_TITLE,这样它就可以填满所有的屏幕,但它不起作用!

public class FabDialog extends android.support.v4.app.DialogFragment {

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setStyle(DialogFragment.STYLE_NO_TITLE,android.R.style.Theme_Holo_Light_NoActionBar);
}

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    return inflater.inflate(R.layout.fab_layout,container,false);

}

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
}

}

0 个答案:

没有答案