1

I am trying to set my alert dialog box Title size and title bar size for which I am not using any text box or theme to display my title name .I am using the following code to set my title name, title background and font color:-

CODE-

@Override
public boolean onLongClick(View arg0) 
   { 
        custom = new Dialog(Activity_AddItem.this);
        custom.setTitle("Selected Product");
        custom.getWindow().setBackgroundDrawableResource(R.color.button_color);
        custom.getWindow().setTitleColor(Color.WHITE);
        custom.show();
        return false;

    }

Snapshot enter image description here

Is there any way to change the titlebar size and title font size without using theme or style or text box?

Rajat kumar
  • 884
  • 9
  • 25

1 Answers1

0

If you use the default implementation of a dialog no, you cannot change those sizes but you can if you create a custom dialog:

-Create a layout for the dialog(title, content, buttons etc)

-inflate that layout into a view

-create a dialog and instead of

dialog.setTitle(...);
dialog.setMessage(...);

etc...

do

dialog.setView(yourcustomview);

this way you have total control over the size of each view in you dialog

nunoh123
  • 1,087
  • 1
  • 10
  • 17