【发布时间】:2013-07-11 16:52:18
【问题描述】:
我想实现这个:
我在屏幕顶部有一个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>
有没有什么简单的方法可以做到这一点?或者我应该怎么做?
【问题讨论】:
-
你能发布你的布局xml代码吗?
-
现在你可以在我的编辑中看到它。
-
问题不够清楚
标签: android scroll imageview scrollview