AlertDialog
のメッセージを別々の2行に1行で表示し、太字のスタイルと次の行の単純なテキスト(スタイルなし)で表示します。AlertDialogボックスで太字と改行のメッセージを表示する方法
今、太字のテキストでブレークラインを実行している場合、行はブレークしますが、テキストは太字で表示されません。どうして ?誰も私を助けることができます。
コード:
AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
alertDialog.setTitle("Alert");
Spanned s1 = Html.fromHtml("<b>" + "Text in Bold"+ "</b>");
String s2 = "Normal Text";
alertDialog.setMessage(s1+ "\n" + s2);
AlertDialog dialog = alertDialog.create();
dialog.show();
利用SpannableStringBuilder代わりの文字列を、あなたがこのリンクをお試しください – Bethan
役立つかもしれない、それは間違いなくあなたを助けるでしょう。 http://stackoverflow.com/questions/4897349/android-coloring-part-of-a-string-using-textview-settext – Bethan