how to scroll a big imageView in ScrollView
来源:互联网 发布:中级程序员考试时间 编辑:程序博客网 时间:2024/06/06 09:20
在做项目 “Heal Your Body” 的时候发现,我无法滚动显示一张大图片,把它放在scrollview里面,它一直不显示。改在程序设置imageView的background,发现它只显示一部分,scrollview 又不滚动。
很郁闷,不知道为什么,今天找一个帖子,好像讲的是同一个问题:
http://stackoverflow.com/questions/3058164/android-scrolling-an-imageview
经过实验发现:不是同一个问题。
后来发现,还是可以把ImageView放在ScrollView里面的:
<ScrollView
style="@style/PDFScrollViewStyle"
android:background="@drawable/lightblue"
android:layout_alignParentTop="true"
android:layout_marginTop="112dp"
>
<ImageView
android:id="@+id/introductionPNG"
style="@style/PDFImageViewStyle"
/>
</ScrollView>
注意你必须在代码里设置 introductionPNG.setBackgroundResource(R.drawable.introduction_1000);
如果直接写android:src="@drawable/introduction_1000" 这样也可以实现,不过当你滚动scrollview的时候,你会发现,可以滚动超出imageView的实际高度,也就是说scrollView可以滚动的高度远远高于imageView中图片的高度。
- how to scroll a big imageView in ScrollView
- How to Scroll in iPhone in Voiceover
- How to establish a big data platform ?
- How to support scroll bar in webkit of android platform
- How to be a Big data Master step 1
- How to Use Scroll Panes
- How to load an ImageView by URL in Android
- How to add subview to a webview so that the subview would scroll along with webview?
- iOS: How To Make AutoLayout Work On A ScrollView
- How to Succeed in A Professional Career
- How To: Implement A Server Plug-in
- How to create a user in PostgreSQL
- How to Rename a View in ClearCase
- How to execute a query in varchar2 ?
- How to Rename a View in ClearCase
- How to access files in a jar?
- How to deploy OS in a cluster
- how to bypass a step in jcl
- 一个“放”字千般哲理。
- java synchronized详解
- 最优化最灵活的Hibernate分页_hql实现
- .NET简谈组件程序设计之(初识序列化、持久化)
- LinkedHashMap用法
- how to scroll a big imageView in ScrollView
- 在java中,将阿拉伯数字转换成大写
- jQeruy 里each循环中的break与continue的替代物return false;和return true;
- 黑客常用的一些cmd命令
- 内存对齐-笔记
- 让DIV浮动在FLASH之上
- 佛山“禅城区智能卡云”入选国家示范项目
- 使用eclipse来Debug的一些技巧
- 将要被淘汰的八种人