gpt4 book ai didi

Android布局绕过带文字的图片

转载 作者:太空狗 更新时间:2023-10-29 13:42:13 25 4
gpt4 key购买 nike

我想实现文本和图像的 android 布局,如左图所示,但是使用 ImageSpan 并在开始时将图像内联到文本中只给我右图上的内容。

有什么解决方案可以漂亮地绕过带文字的大图吗?

|-------------| texttexttexttexttext   |-------------| 
| | texttexttexttexttext | |
| image | texttexttexttexttext | image |
| | texttexttexttexttext | |
|-------------| texttexttexttexttext |-------------| texttexttexttexttext
texttexttexttexttexttexttexttexttext texttexttexttexttexttexttexttexttext
texttexttexttexttexttexttexttexttext texttexttexttexttexttexttexttexttext
texttexttexttexttexttexttexttexttext texttexttexttexttexttexttexttexttext
|

最佳答案

可以通过使用 WebView 和编写 HTML 代码来实现。也可以通过使用 Html.fromHtml(String, Html.ImageGetter, Html.TagHandler) 将 HTML 插入到 TextView 中来实现.查看使用 ImageGetter 的示例 here .

关于Android布局绕过带文字的图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4309198/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com