我正在使用一个片段,其中我的布局由顶部(标题)上的文本和其下方的图像以及其下方的另一块文本组成。我想让它使图像向左移动,包括标题在内的文本和其余的向右移动,一旦图像边界超过它就从左侧开始,更像是在网页上环绕(对不起对于我糟糕的解释,希望我能说得好)。任何线索如何重新排列我现有的代码或进行更改以达到目的?
谢谢!这是我的代码(autoresizeimage 是图像代码):
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:foo="http://schemas.android.com/apk/res/com.cookie.halloween"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/login_background_gradient" >
<ScrollView
android:id="@+id/news_details_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="6dp ">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/background_article_body"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingTop="@dimen/common_top_padding"
android:paddingRight="10dp"
android:paddingBottom="10dp" >
<com.cookie.halloween.utils.FontTextView
android:id="@+id/news_headline"
foo:customFont="Cabin-Medium.ttf"
android:textSize="18sp"
android:textColor="@color/article_headline"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.cookie.halloween.utils.FontTextView
android:id="@+id/news_timestamp_and_source"
foo:customFont="Roboto-Regular.ttf"
android:textSize="11sp"
android:textColor="@color/article_source"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.cookie.halloween.views.AutoResizeImageView
android:id="@+id/news_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/common_top_padding"
android:layout_marginBottom="@dimen/common_bottom_padding" />
<com.cookie.halloween.views.LinkableTextView
android:id="@+id/news_body"
foo:customFont="Roboto-Regular.ttf"
android:textSize="13sp"
android:lineSpacingExtra="3dp"
android:textColor="@color/article_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/related_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="9dp"
android:background="@drawable/background_article_body"
android:orientation="vertical" >
<TextView
android:id="@+id/related_articles"
style="@style/related_buttons"
android:layout_width="match_parent"
android:layout_height="50dp"
android:contentDescription="@string/content_description_related_articles"
android:text="@string/content_description_related_articles" />
<View
android:id="@+id/related_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/related_divider"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:visibility="gone" />
<TextView
android:id="@+id/related_quotes"
style="@style/related_buttons"
android:layout_width="match_parent"
android:layout_height="50dp"
android:contentDescription="@string/content_description_related_quotes"
android:text="@string/content_description_related_quotes" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<include layout="@layout/loading_no_results" />
</FrameLayout>