Dialog box title text size in Android

android, android-alertdialog

Solution

To achieve this:

- Create an xml with list view

- Inflate that view with inflater

- Set custom view in AndroidBuilder

- Use custom Adapter to inflate row in listview.

Doing above point you will achieve your customization.

You can use below example for same:

http://www.mkyong.com/android/android-custom-dialog-example/ http://www.edumobile.org/android/android-development/custom-listview-in-a-dialog-in-android/

I hope it will help for you.

Problem

I am working on an Android application in which I want to set the text size of my dialog box. I have used the following code an XML for textview but it is only setting the size of my fields. I want to set the text size and color of my title as well. ``` final CharSequence[] items = { "Fake Request", "Abusive Language","Indecent Approach","Unacceptable Attitude","Dangerous Behavior",}; ArrayAdapter<CharSequence> itemsAdapter = new ArrayAdapter<CharSequence> (this, R.layout.menu_items, items); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("My Title"); builder.setIcon(R.drawable.icon); builder.setAdapter(itemsAdapter, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { switch(item) { case 0: //Mark as Beautiful break; case 1: //Mark as Beautiful break; case 2: //Mark as Not a Portrait break; case 3: //Mark as Offensive break; case 4: //Mark as Spam break; case 5: //cancel break; } } } ); builder.show(); <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="10dip" android:layout_margin="5dip" android:gravity="center_vertical" android:textSize="5dip" android:textColor="@color/red_theme" android:typeface="normal" android:lineSpacingExtra="0dip"/> ```

Original source

Related problems