In My android app, It is an alert dialog but there is one problem It have extra space from top of the title . How to remove extra space can anyone help me.
java code
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_welcome_from);
final AlertDialog.Builder builder =
new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyle);
Typeface tfmain = Typeface.createFromAsset(getAssets(), fontFooterpath);
Typeface tfContent = Typeface.createFromAsset(getAssets(), fontMain);
CustomTFSpan tfSpan = new CustomTFSpan(tfContent);
SpannableString spannableString = new SpannableString("Welcome");
spannableString.setSpan(tfSpan, 0, spannableString.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
builder.setTitle(spannableString);
CustomTFSpan tfSpan1 = new CustomTFSpan(tfmain);
SpannableString spannableString1 = new SpannableString("Hello");
spannableString1.setSpan(tfSpan1, 0, spannableString1.length(), spannableString1.SPAN_EXCLUSIVE_EXCLUSIVE);
builder.setMessage(spannableString1);
builder.setPositiveButton("START", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Intent ii = new Intent(WelcomeFromActivity.this, Question1Activity.class);
startActivity(ii);
}
});
builder.setCancelable(false); //for prevent outside touch
builder.show();
}
Can anyone know that how to remove extra space from alert dialog title.