CSS   发布时间:2022-04-17  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ImageView和TextView float(左/右)Android大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在寻找一种方法来将我的文字放在我的图像视图周围(所以像css float左/右).

如何在Android中执行此操作?我已经使用android:layout_alignParentLeft =“true”(放置我的图像左侧)和android:layout_alignParentright =“true”为我的textview,但
textview在imageView旁边,当我有一个长文本时,它不会继续在ImageView下面.

有任何想法吗?

解决方法

我有同样的问题,试图让一个ImageView对齐在一个RelativeLayout的左边.我使用android:scaleType =“fitStart”来修复它.

我的XML文件:

<RelativeLayout
      xmlns:android="http://scheR_454_11845@as.android.com/apk/res/android"
      android:orientation="horizontal"
      android:layout_height="fill_parent"
      android:layout_width="fill_parent"
      android:padding="10dp">
     <ImageView
         android:layout_height="50dp"
         android:id="@+id/country_icon"
         android:layout_alignParentLeft="true"
         android:layout_width="wrap_content"
         android:scaleType="fitStart" />          
</RelativeLayout>

大佬总结

以上是大佬教程为你收集整理的ImageView和TextView float(左/右)Android全部内容,希望文章能够帮你解决ImageView和TextView float(左/右)Android所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。