顶部对齐一个TextView里面的图片 [英] Top aligned Image inside a TextView

查看:263
本文介绍了顶部对齐一个TextView里面的图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在Android中的一个TextView插入图片和调整像下面这样的形象?

Is it possible in Android to insert an image in a TextView and align the text like this image below ?

感谢你在前进!

推荐答案

如果我没记错的话,实际上只有两种方法在Android中做到这一点。

If I remember correctly there are really only two ways to do this in android.


  1. 创建HTML资产和数据注入到web视图。 (显然不是你所期待的。

  1. Create an HTML asset and inject your data to the webview. (Obviously not what you are looking for.

创建一个带有 ImageSpan

路线二是可能更多你所寻找的。什么

Route two is probably more what you are looking for.

修改
进一步寻找到它似乎ImageSpans只能底部或基线对齐的文字。既然你是专门询问一个TextView。不,你问什么是不可能从我的理解一个TextView。

EDIT Looking further into it it appears that ImageSpans can only Bottom or Baseline-Align with the text. And since you are specifically asking about a TextView. No what you are asking is not possible with a TextView from my understanding.

这篇关于顶部对齐一个TextView里面的图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆