Sunday, December 6, 2015

Android Toast 폰트 변경 및 single line 만들기

// 토스트 폰트 통일
final LinearLayout toastLayout = (LinearLayout) toast.getView();
final TextView toastTV = (TextView) toastLayout.getChildAt(0);

toastTV.setTypeface(Typeface.createFromAsset(getAssetManager(), "NanumGothic.otf"));

if(singleLine) {
    toastTV.setSingleLine(true);
    toastTV.setEllipsize(TextUtils.TruncateAt.END);
}

toast.show();

No comments:

Post a Comment