如何使图像和文字左,下,它的布局? [英] How to make layout of an image and text left and under it?

查看:90
本文介绍了如何使图像和文字左,下,它的布局?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要做一个布局,专用于网页,它需要看起来像一个图像网络文章和文字留下来,并在其下。看图像。

I need to make a layout which is specific to webpage and it needs to look like a web article with an image and a text left to and under it. Look at the image.

由于这是一个容易的事在网络的世界里,我不知道怎么做,在XML布局。

As this is an easy thing to do in a web world, I am not sure how to do it in XML layout.

显然, TextView的必须是在左侧而图像是present,和之后到达图像的底部,它具有可拉伸至屏幕宽度。我想这两个 TextViews (一个用于左,另一个用于底部),但它只是看起来不正确由于文本字体大小。

Obviously, the TextView must be on the left while the image is present, and after it reaches the bottom of the image, it has to stretch to the screen width. I tried this with two TextViews (one for left and another for bottom), but it just does not look right due to the text font size.

修改

我也试过dinamically捉图像的高度,然后将其分配给我的TextView,然后再拍的TextView与屏幕的这两种元素下的大小。这并不工作,以及我无法控制不可见,由于限制了TextView的第一高度的文本。

I also tried to dinamically catch the height of image and then assign it to my TextView, and then make another TextView with the size of the screen under these two elements. This does not work as well as I cannot control the text that is not visible due to limited height of the first TextView.

推荐答案

最好的解决办法是这样的一种:的 http://dev.androidteam.ru/snippets/textview/leadingmarginspan2

The best solution was this one: http://dev.androidteam.ru/snippets/textview/leadingmarginspan2

和它的作品。

这篇关于如何使图像和文字左,下,它的布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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