我想实现这个:
我ImageView
在屏幕顶部有一个,总是留在那里。在它上面我使用ScrollView
, 一些对象依赖于Activity
. 最后,我有另一个ImageView
行为应该是:
ScrollView
留在大屏幕视图的底部,即当内部对象之后和屏幕结束之前有太多空间时。用小屏幕滚动,就是当所有对象都看不到时,它们将是可滚动的,我想
ImageView
在最后看到。
这是我的最新代码
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context=".ContactoActivity"
android:orientation="vertical" >
<!-- LinearLayout with ImageView I have at the top of the view -->
<ScrollView
android:id="@+id/scrollViewMain"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/linearLayoutLogoFactor_contacto"
android:layout_marginTop="7dp">
<RelativeLayout
android:id="@+id/relativeLayoutMain"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true">
<!-- Some other objects -->
<!-- ImageView I want to stay at the bottom but being scrollable -->
<LinearLayout
android:id="@+id/linearLayoutImagenInferior_contacto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/linearLayoutVerInfoContacto"
android:gravity="center_horizontal" >
<ImageView
android:id="@+id/imageViewImagenInferior_contacto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/la_electrica_de_las_empresas" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
</LinearLayout>
有什么简单的方法可以做到这一点吗?或者我应该怎么做?