Text selection tools in ActionBar are white on whi

2019-08-10 04:53发布

问题:

Anyone had this issue, that after selecting text in dialog's EditText, toolbar appears with invisible action buttons (white on white background)?

How do I set theme to a DialogFragment?

回答1:

You can custom dialog theme in styles.xml:

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

then use MyDialogTheme in your DialogFragment


UPDATE

In your dialog use following codes to set custom theme:

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