【问题标题】:android: displaying html string and an imageandroid:显示html字符串和图像
【发布时间】:2011-12-06 13:48:36
【问题描述】:

我想在一个页面中显示 html 字符串的内容并在同一页面中显示图像。我试过定义这样的布局

<RelativeLayout android:layout_width="wrap_content"
        android:layout_height="fill_parent" android:background="@drawable/home_bg">
        <ImageView android:id="@+id/aboutcmkimage"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_alignParentRight="true" android:src="@drawable/about"
            android:padding="5dip" />
        <WebView android:id="@+id/aboutcmk" android:layout_width="wrap_content"
            android:layout_height="fill_parent" android:textColor="#000000"
            android:layout_toLeftOf="@+id/aboutcmkimage"

            android:layout_alignParentTop="true" android:layout_alignParentLeft="true" />

    </RelativeLayout>

问题在于,显示为两个不同的列。第一列显示的 html 字符串和下一列的图像。我希望两者混合在一起并看起来像一个页面。我希望文本出现在图像的左侧以及图像下方的所有空间中。请帮助我实现这一目标。非常感谢您的宝贵时间

【问题讨论】:

    标签: android html image


    【解决方案1】:

    尝试框架布局或合并。这里给出了一个很好的例子 - http://developer.android.com/resources/articles/layout-tricks-merge.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-22
      • 1970-01-01
      • 1970-01-01
      • 2019-03-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多