我有一个对话框片段和一个
的createView@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.zse_dialog, container,false);
return view;
}
我用
调用片段expandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v,int groupPosition, int childPosition, long id)
{
FragmentManager fm = getFragmentManager();
DialogF dialogFragment = new DialogF ();
dialogFragment.show(fm, "Sample Fragment");
return false;
}
});
但似乎压缩在屏幕中央。
我如何让它以全屏显示或几乎全屏显示
答案 0 :(得分:0)
如果您的活动中有一个容器可以显示DialogFragment,您可以将其添加为常规片段,如下所示
getFragmentManager()
.beginTransaction()
.add(R.id.container, new MyFragment(), "fragment_tag")
.commit();