Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在android中用图像下方的内容填充空白_Android_Android Layout_Xml Layout - Fatal编程技术网

如何在android中用图像下方的内容填充空白

如何在android中用图像下方的内容填充空白,android,android-layout,xml-layout,Android,Android Layout,Xml Layout,我的xml布局中有一个ImageView和一个TextView。我想在ImageView的右侧显示我通过webservice获得的以下文本。我可以用那个文本视图显示那个文本吗 我试图在xml布局中给android:singleLine=false,但没有用。这里已经讨论过了: 这里呢 显然,一个解决方案是使用一个可扩展的,而ImageSpan就是这个答案 另一个解决方案是使用webview并使您在html中进行布局 用法示例: <com.pagesuite.flowtext.FlowTe

我的xml布局中有一个ImageView和一个TextView。我想在ImageView的右侧显示我通过webservice获得的以下文本。我可以用那个文本视图显示那个文本吗


我试图在xml布局中给android:singleLine=false,但没有用。

这里已经讨论过了: 这里呢

显然,一个解决方案是使用一个可扩展的,而ImageSpan就是这个答案

另一个解决方案是使用webview并使您在html中进行布局

用法示例:

 <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>
对于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

我正在从webservice获取文本,如何将该文本设置为html您不必将其转换为html。不要使用spanable just tv.setTextyourtextfromwebservice;如何将webservice文本转换为html@talhakosenI编辑我的帖子检查在那里,有两种用法flowtextview。其中一个是html,另一个是纯文本.lagy。即使是库的示例也无法平滑滚动
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