Place A Button Inside Dialogfragment's Title
I show a DialogFragment from another DialogFragment. I need to set title and a button just next to it. I don't want to reimplement the theme and create a custom view inside DialogF
Solution 1:
Try something like this:
// TitlefinalinttitleId= getResources().getIdentifier("alertTitle","id","android");
TextViewtitle= (TextView) popup.findViewById(titleId);
title.setText("My new title");
// Title's parent layoutViewGroupviewGroup= (ViewGroup) title.getRootView();
// ButtonButtonbutton=newButton(this);
button.setText("A Button");
viewGroup.addView(button);
Note: You may need to adjust the button
and title
objects' LayoutParams
.
Post a Comment for "Place A Button Inside Dialogfragment's Title"