1
我想在文本視圖中顯示一個圖像,在文本本身的前面。我試過CompoundDrawable
,但第二行的文本不在第一行的圖像下面。使用spannablestring追加文本左邊的圖像
我需要是這樣的:在結束的開始,而不是
var imageSpan = new ImageSpan(this, Resource.Drawable.Icon); //Find your drawable.
var spannableString = new SpannableString(textView.Text); //Set text SpannableString from TextView
spannableString.SetSpan(imageSpan, textView.Text.Length -1, textView.Text.Length, 0); //Add image at end of string
但圖像。
您是否嘗試過的Android? –