我想在我的文本视图中,在文本本身之前显示一个图像。我试过了,CompoundDrawable
但第二行的文字没有出现在第一行的图像下方。
我需要这样的东西:
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
Run Code Online (Sandbox Code Playgroud)
但是图像在开头而不是结尾。