在对话框中选择文本后,ActionBar 中的文本选择工具在白色背景上为白色

Text selection tools in ActionBar are white on white background after selecting text in Dialog

有人遇到过这个问题吗,在对话框的 EditText 中选择文本后,工具栏会出现带有不可见操作按钮(白色背景上的白色)?

如何将主题设置为 DialogFragment?

您可以在 styles.xml 中自定义对话框主题:

<style name="MyDialogTheme" parent="android:Theme.Holo.Dialog" />   

然后在 DialogFragment

中使用 MyDialogTheme


更新

在您的对话框中使用以下代码设置自定义主题:

ContextThemeWrapper context = new ContextThemeWrapper(getActivity(), R.style.MyDialogTheme);
AlertDialog.Builder builder = new AlertDialog.Builder(context);
... ...