安卓:滚动型问题
问题描述:
我试图让一个大的图像视图滚动使用静态背景图像。 问题我面临的是,有很多的来临图像视图上方的*空间,我必须向下滚动才能看到我的形象。安卓:滚动型问题
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background_mdpi"
android:gravity="top"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_margin="11dp"
android:gravity="top"
android:background="@drawable/panel" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:src="@drawable/help_screen" />
</ScrollView>
</LinearLayout>
</LinearLayout>
如何摆脱这个额外的空间,看到我的图像,并将它向下滚动,因为它是长图像。
感谢 阿比纳夫·特亚吉
答
见安卓scaleType http://developer.android.com/reference/android/widget/ImageView.ScaleType.html
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:sourceType="fitStart"
android:src="@drawable/help_screen" />
答
正如西蒙说:
我用的android:scaleType = “fitStart” 在我的ImageView,这解决了我的问题
看看安卓scaleType – Simon
在其布局把这个? –
谢谢...:d 用它里面的ImageView与价值= fitStart –