Android Alert Dialog replace default blue with another color -
I am using a single option warning dialog in which I want to change the default blue color (headline and radio button) I'm using in the title bar that for the orange I could change the title bar using the For the title bar Creating alert dialogs This is what it looks like I have to get rid of this blue color! << Div> The only way to change the title divider color is Single option item layout : I have generated Implementation Result setCustomTitle () , but I'm trying to get rid of this blue color.
& Lt; / LinearLayout & gt;
AlertDialog Builder Builder = New AlertDialog Builder (main activity.); See custom-cutle = seeinstet (main activity., R.Let.CustomMelt_light_title, empty); Builder.setCustomTitle (customTitle); Builder.setSingleChoiceItems (mAlertOptions, -1, New DialogInterface.OnClickListener) {@Override Public Zero onClick (DialogInterface dialog, integer which) {// stuff dialog.dismiss ()}}}}. () Create show ();
resources.getIdentifier Combination,
Window.findViewById . You can easily change the checkmark by calling
AlertDialog.Builder.setSingleChoiceItems (ListAdapter, int, OnClickListener) .
your_radio_button using
& Lt; Checked textview xmlns: Android = "http://schemas.android.com/apk/res/android" Android: ID = "@Android: ID / Text1" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" Android: Right mark = "@ drawable / your_radio_button" Android: Ellipsize = "Marquee" Android: Gravity = "center_vertical" Android: minHeight = "Android: attr / listPreferredItemHeightSmall" Android: paddingEnd = "16dip" Android: paddingStart = "16dip "Android: Text Appointment =" Android: ATR / Text Experience Yum "android: text = client"? Android: ATR / Tekstcolrelitdayloglistaitm "/ & gt;
Last ListAdapter Adapter = New ArrayAdapter & LT; String & gt; (This, R.layout.select_dialog_singlechoice, android.r.id.text1, new string [] {"option1", "option2"}); Final AlertDialog.builder Builder = New AlertDialog.Builder (this); Builder.setCustomTitle (getLayoutInflater () .Fullo (R.Lateout_Lert_title, empty)); Builder.setSingleChoiceItems (Optimizer, -1, New DialogInterface.OnClickListener () {@Override Click Public Zero (DialogInterface dialog, int which) {// do something}}); // AlertDialog Show the final AlertDialog dialog = builder.show (); // The last resource resource that divides the title = res = getResources (); Final Ent TitleDidderID = Reset. Deliverifier ("title dividers", "id", "Android"); Title titleDivider = dialog.findViewById (titleDividerId); TitleDivider.setBackgroundColor (res.getColor (android.R.color.holo_orange_dark));
Comments
Post a Comment