如何显示一个大的PNG文件

如何显示一个大的PNG文件

本文介绍了如何显示一个大的PNG文件,并在其周围滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我想显示和它周围的滚动,我可以在一个网页视图做一个大的PNG图像文件。当我打开我的图片文件活性成ImageView的图像显示在屏幕上,但太小阅读。我想缩放控制将有助于一旦它在它的正常大小的图像。我在一个web视图使用图像试过,但我不想要的网址显示。

I have a large Png image file that I would like to display and scroll around it as I can do in a WebView. When I load my activity with the image file into an ImageView the image is displayed in the screen but is too small to read. I guess the Zoom controls will help once the image it is at it's normal size. I have tried using the image in a WebView but I don't want the Url displayed.

推荐答案

我已经做了一个TableLayout类似的东西。我把它包在嵌套在一个Horizo​​ntalScrollView滚动型,用户能够当我的TableLayout占用比将在屏幕上显示更多的空间,全方位地左右滚动。我想这将与ImageView的正常工作。事情是这样的:

I've done something similar with a TableLayout. I wrapped it in a ScrollView nested in a HorizontalScrollView and the user is able to scroll around in all directions when my TableLayout takes up more space than what will fit on the screen. I imagine this would work with an ImageView as well. Something like this:

    <HorizontalScrollView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <ScrollView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
        </ScrollView>
    </HorizontalScrollView>

这篇关于如何显示一个大的PNG文件,并在其周围滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 09:45