草庐IT

DialogFragment-B

全部标签

android - 具有多个 fragment/ View 的 DialogFragment

如何用动画一个接一个地显示一个包含多个fragment的对话框fragment?我的用例是:DialogFragment与fragment1一起显示。它有一个“下一步”按钮用户点击下一步同一个dialogFragment显示带有动画幻灯片的fragment2。任何指针都会有所帮助。提前谢谢你。这是我正在使用的基本对话fragmentpublicclassBaseDialogFragmentextendsDialogFragment{publicBaseDialogFragment(){}publicstaticBaseDialogFragmentnewInstance(Stringti

android - 带有自定义 ListView 的 DialogFragment

我正在尝试创建一个DialogFragment,它显示一个内部带有自定义ListView的对话框。publicclassMultiSelectDialogCustomextendsDialogFragment{ListViewmLocationList;privateArrayListmOfficeListItems=newArrayList();publicstaticMultiSelectDialogCustomnewInstance(inttitle){MultiSelectDialogCustomdialog=newMultiSelectDialogCustom();Bundl

android - 如何将 DialogFragment 移出中心?

是否可以通过使用DialogFragment将其移出中心并将其放置在屏幕上的任意位置? 最佳答案 你可以使用getDialog().getWindow().setAttributes(param);在onCreateView()像这样@OverridepublicViewonCreateView(LayoutInflaterinflater,ViewGroupcontainer,BundlesavedInstanceState){getDialog().getWindow().setGravity(Gravity.CENTER_HO

android - getSupportFragmentManager 不在 DialogFragment 上编译

我怎样才能显示这个:publicclassTagsDialogextendsDialogFragment{@OverridepublicDialogonCreateDialog(BundlesavedInstanceState){AlertDialog.Builderbuilder=newAlertDialog.Builder(getActivity());LayoutInflaterinflater=getActivity().getLayoutInflater();builder.setView(inflater.inflate(R.layout.tags_dialog,null)

android - 从 DialogFragment 中的 EditText 获取文本

我有一个像这样的DialogFragment通过单击下面最初为空的MainActivity中的“加号”按钮调用对话框。当我点击“继续”时,我创建了一个按钮,到目前为止它可以正常工作。我还希望我在DialogFragment的EditText中插入的字符串显示在我刚刚创建的按钮上。我的问题是我无法检索我在EditText中输入的字符串。代码如下:主要ActivitypublicclassMainActivityextendsFragmentActivityimplementsIProjectDialFrag{privateProjectDialogFragmentprojectDialF

java - 传递 Android DialogFragment 参数时,onCreateDialog bundle agument 意外为空

我正在尝试使用DialogFragment在Android中显示一个基本对话框,并使用对话框消息的参数,如StackOverflowthread中所述。和DialogFragmentdocumentation.我的问题是onCreateDialog中的Bundle参数savedInstanceState总是显示为null,这意味着Activity显示一个空对话框而不是带有消息的对话框。如何从newInstance工厂方法中获取非空包内容以显示在onCreateDialog中?或者我只是想念别的东西?我从文档中看到的唯一显着差异是我使用的是非静态类。我希望肯定对话按钮取决于消息的内容,所

android - 隐藏以在 DialogFragment 中显示和隐藏键盘

在我的对话框fragment中,我可以使用显示键盘getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUTSTATE_VISIBLE);但我无法在dismiss上隐藏它。我试过了getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);和getDialog().getWindow().setSoftInputMode(WindowManager.LayoutPa

android - DialogFragment 被状态栏重叠

我有点困惑。起初,当我创建一个工具栏并且它被状态栏重叠时,我只是在父XML中添加fitSysmtemWindow="true"并且它工作得很好。但是当我创建全屏DialogFragment时,它也会被状态栏重叠。我尝试添加fitSystemWindow="true"但它不起作用。仅适用于android5.0+。没有在任何地方将状态栏设置为半透明。这是我的DialogFragment代码@OverridepublicViewonCreateView(LayoutInflaterinflater,ViewGroupcontainer,BundlesavedInstanceState){//

android - 从 DialogFragment 调用 registerReceiver

编辑我添加了这一行:getActivity().registerReceiver(newBroadcastReceiver(){...},newIntentFilter(SENT));虽然现在有一个运行时错误,错误如下:09-0304:12:41.856:E/AndroidRuntime(1692):java.lang.IllegalStateException:在Activity类android.view.ContextThemeWrapper中找不到方法sendMessage(View)用于onClick处理程序查看id为“button_send”的android.widget.I

android - 删除dialogfragment中的白色背景

这是我调用DialogFragment的方式:DialogSelectAccountmyDiag=newDialogSelectAccount();myDiag.show(ft,"Diag");以下是(部分)我的DialogFragment的创建方式:publicclassDialogSelectAccountextendsDialogFragment{publicDialogSelectAccount(){}@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);