如何填补的空白,在Android上的图片下面的内容 [英] How to fill the empty spaces with content below the Image in android

查看:110
本文介绍了如何填补的空白,在Android上的图片下面的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ImageView的,在我的XML布局一个TextView。我想说明下面,我得到通过web服务右侧的ImageView的文本。我可以告诉文本通过使用一个TextView中?

I have one ImageView and a TextView in my xml layout. I want to show the text below that i got by webservice on the right side of the ImageView. Can i show that text by using that one TextView ?

我试着给机器人:单线=假,在XML布局,但没有用

I tried to give android:singleLine="false" in xml layout but no use.

推荐答案

<一个href="http://$c$c.google.com/p/android-flowtextview/">http://$c$c.google.com/p/android-flowtextview/

实例:

 <com.pagesuite.flowtext.FlowTextView
            android:id="@+id/tv"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:padding="10dip"
                android:src="@drawable/android" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_marginTop="400dip"
                android:padding="10dip"
                android:src="@drawable/android2" />
        </com.pagesuite.flowtext.FlowTextView>

您code:

对于文本:

tv = (FlowTextView) findViewById(R.id.tv);                  
tv.setText("my string"); // using plain text    
tv.invalidate(); // call this to render the text

有关HTML:

tv = (FlowTextView) findViewById(R.id.tv);              
Spanned spannable = Html.fromHtml("<html ... </html>");
tv.setText(spannable);  // using html
tv.invalidate(); // call this to render the text

这篇关于如何填补的空白,在Android上的图片下面的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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