3

如何设置背景图像以使用 ScrollView 滚动?例如,我想显示一个 640x480 的图像,如果向下滑动,它必须显示我图像的另一个 480 dp。

4

2 回答 2

1

尝试

<ScrollView> 
<RelativeLayout>
<ImageView>  with "wrap_content","wrap_content" and App background here
.
.
.

我没有尝试过,但我想它会起作用的..

于 2012-10-10T19:27:05.867 回答
0

I'm not sure if you can do that with scrollView but if you want to change your application to scroll horizontally you might consider implement a ViewPager and set a different background at each page. It will smoothly switch between pages displaying different picture on the full screen. You might want to check this tutorial: http://thepseudocoder.wordpress.com/2011/10/05/android-page-swiping-using-viewpager/

于 2012-10-10T19:16:13.043 回答