EditText の ContextMenu のスタイルに問題があります。
新しいダイアログを作成しました:
Dialog newServerDialog = new Dialog(getContext(), R.style.CustomDialogStyleServerDetails);
newServerDialog.setContentView(newServerDialogLayout);
newServerDialog.setTitle(R.string.server_details_new_title_text);
newServerDialog.getWindow().setLayout(
android.view.ViewGroup.LayoutParams.FILL_PARENT,
android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
newServerDialog.setCancelable(true);
CustomDialogStyleServerDetailsスタイルは次のとおりです。
<style name="CustomDialogStyleServerDetails" parent="@android:style/Theme.Dialog">
<item name="android:background">@drawable/server_details_background_repeat</item>
<item name="android:windowTitleStyle">@style/DialogWindowTitle</item>
</style>
そしてDialogWindowTitleスタイル
<style name="DialogWindowTitle">
<item name="android:maxLines">1</item>
<item name="android:scrollHorizontally">true</item>
<item name="android:textAppearance">@style/customDialogTextAppearance</item>
<item name="android:gravity">center_horizontal|center_vertical</item>
<item name="android:background">@drawable/server_details_title_background_repeat</item>
</style>
ダイアログは私が望むように見えます: (申し訳ありませんが、まだ画像を投稿できません)
しかし、EditText の ContextMenu は私のダイアログからスタイルを取ります
デフォルトのスタイルを ContextMenu に設定する方法はありますか?
この問題の修正は見つかりませんでした。
すべての助けに感謝します!
ありがとうございました。
EDIT:私にとっての解決策:Dialogを拡張するカスタムクラス(DialogServerと呼ばれる)を作成します。
編集#2:いいえ、それは正しい解決策ではないようです。
私はこのコンストラクタを試しました:
public DialogServer(Context context, int theme)
そして問題は残る
このコンストラクターでは:
public DialogServer(Context context)
contextmenu のスタイルは問題ありませんが、ダイアログのスタイルはなくなりました。