xml - Android Custom AlertDialog not drawn correctly -
The problem I'm trying to optimize as an AlertDialog is that I do not know the black lines How to get rid of what appears above my first text view and editing text (above the gray button areas).
Here's my XML. What am I missing?
& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; LinearLayout xmlns: android = "Http://schemaskandroidkcom/apk/res/android" android: orientation = "vertical" android: background = "@ color / butGreyBack" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" & gt; & Lt; TextView android: id = "@ + id / TV_TITLE" Android: Layout_width = "Wrap_content" Android: layout_height = "0dp" Android: Layout_gravity = "center" Android: layout_weight = "30" android: text = "" android: background = "# 00000000" android: text collar = "@ android: color / white" android: text size = "22 SP" Android: Leaut_margin = "0 DP" android: gravity = "center" / & gt; & Lt; TextView android: id = "@ + id / tv_prompt" Android: Layout_width = "Wrap_content" Android: layout_height = "0dp" Android: Layout_gravity = "center" Android: layout_weight = "30" android: text = "" android: background = "# 00000000" Android: text collar = "@ Android: color / white" Android: text size = "18sp" Android: layout_margin = "0dp" Android: gravity = "center" /> & Lt; Android: layout_height = "wrap_content" android: layout_marginTop = "16dp" Android: layout_marginLeft = "4dp" Android: inputType = "textCapSentences | textAutoCorrect" Android: layout_width = "match_parent" Android: layout_marginLeft = "4dp" Android: id = "@ + id / edit_text" Android : Layout_margin right = "4dp" Android: layout_marginbottom = "4dp" /> & Lt; / LinearLayout & gt; Here's the code - which is probably where the problem is:
View alert view; AlertDialog.builder Builder = New AlertDialog.Builder (mContext); Layout Inflight Inflight = Layout Inflator. Frame (getApplicationContext ()); AlertView = inflater.inflate (R. layout.lert_dialog_text, empty); Builder.setView (warning view); Alert Dealog Warning Dialog = Builder.Create (); AlertDialog.setView (alert view, 0,0,0,0,0,0); Last Editing Tap Input = (Editing Text) Alert VIFFIFIFIIDIID (RaidAditText); TextView tvTitle = (TextView) alertView.findViewById (R.id.tv_title); TextView tvPrompt = (TextView) alertView.findViewById (R.id.tv_prompt); TvTitle.setText ("Rename Playlist"); TvPrompt.setText ("Enter new playlist name."); // Set button builder.setPositiveButton ( "OK", the new DialogInterface.OnClickListener () {@Override public void onClick (DialogInterface dialog, int which) {mNewName = input.getText () toString () ;.}}); builder.setNegativeButton ( "Cancel", new DialogInterface.OnClickListener () {@Override public void onClick (DialogInterface dialog, int which) {mNewName = ""; dialog.cancel ();}}); Builder.show ();
@specci ...
1) values in xml Folder and Add This Code
wrap_content wrap_content @ color / transparent1 is incorrect and make reference to this topic for your dialog
dialog dialog = new dialog (activity, r style. CustomDialogTheme);
dialog.setContentView (R.layout.customdialog);
2) You are not ending parental linearLayout at the end
P>
And you're using the # 000000 color code for the parent layout, It will display black color in the background
Try changing the color of the color so that you get a chance to paint. And
request WindowFeature (Window.FEATURE_NO_TITLE);
You will remove this dialog titled in the dialog section so that your color is also deleted.
Let me know if you need any help
Thanks
Comments
Post a Comment