gpt4 book ai didi

android - DialogFragment在Android中的位置

转载 作者:行者123 更新时间:2023-11-30 03:12:48 26 4
gpt4 key购买 nike

<分区>

我试图在屏幕上的特定位置找到我的对话框。这是我的对话实现:

public class DayDialog extends android.support.v4.app.DialogFragment {
public static DayDialog newInstance() {
DayDialog f = new DayDialog();
f.setCancelable(true);
f.setStyle(STYLE_NO_TITLE, 0);
return f;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View layout = inflater.inflate(R.layout.dialog_calendar_day, container);
WindowManager.LayoutParams params = getDialog().getWindow()
.getAttributes();
params.gravity = Gravity.TOP | Gravity.LEFT;
params.x = 0;//b.getInt("x");
params.y = 0;//b.getInt("y");
getDialog().getWindow().setAttributes(params);
return layout;
}

这是我的对话框的显示方式!我怎样才能找到它 (0,0) ?好像周围有个框什么的!

screenshot

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com