Reputation: 3784
Suppose I have a dialog which is opened from java file . I want to set multiline title of these dialog box.
dialog = new Dialog(context);
dialog.setContentView(R.layout.issue_attachment_preview);
String title=getString(R.string.previewImageDialogTitle)+"\n ["+attachment.filename+"]";
dialog.setTitle(title);
dialog.setCancelable(true);
But it does not display title in multiline , please suggest me any usable link or example.
Upvotes: 4
Views: 4858
Reputation: 4340
Add
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
immediately after calling super.onCreate
and just before setContentView
.
Then add the multiline textview on top of your dialog layout which will work as title
Upvotes: 3
Reputation: 101
TextView tv = (TextView) dialog.findViewById(android.R.id.title);
tv.setSingleLine(false);
Upvotes: 10