我有以下佈局:如何使圖像查看佈局的底部邊框?
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:clickable="true"
android:background="@drawable/mydrawable"
android:layout_width="match_parent"
android:layout_height=80dp">
<TextView
android:id="@+id/my_text_view"
android:textSize="@dimen/label_text"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/textPadding"
android:paddingLeft="@dimen/textPadding"
android:paddingRight="@dimen/textPadding"
android:text="This is some text"/>
<include layout="@layout/my_separator"/>
</LinearLayout>
和佈局my_separator.xml
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:scaleType="fitXY"
android:src="#FF00FF" />
基本上這個佈局具有文本視圖和充當分離器另一佈局。
問題:
我需要顯示在佈局和分離器中間的文本是在最底部。即充當父線性佈局的固體邊界。
所以現在是這樣的:
++++++++++++++++++++++++ (linear layout)
This is some text
--------------------- (Separator)
++++++++++++++++++++++++ (linear layout) - bottom
但我想
++++++++++++++++++++++++ (linear layout)
This is some text
------------------------ (Separator) - linear layout bottom
我怎樣才能做到這一點?
注:我需要保持我已經爲佈局
@SaschaKolberg:我試過在imageview裏面。它沒有工作 – Jim