简体   繁体   English

如何全屏显示图像

[英]How to show the image in full view

I have an image and I need it to be shown with its full view as it is. 我有一张图片,我需要以它的完整视图显示它。 But the image is shown in the phone after loading is reduced to fit the screen. 但是在减少加载以适合屏幕后,图像会显示在手机中。 how do I include the image in full size and resolution as it is so that it can be scrolled to see the width? 如何包含完整尺寸和分辨率的图像,以便可以滚动查看其宽度?

Here is my layout file: 这是我的布局文件:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#EEEEEE">

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
 android:scrollbars="vertical" 
 android:layout_height="wrap_content" 
 android:layout_width="fill_parent"
 android:background="#77aa88">

<LinearLayout 
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:background="#FFFFFF">

<TextView   android:text="Xkcd"
        android:textColor="#6E7B91"
        android:textSize="28dp"
        android:textScaleX="1.8"

        android:id="@+id/TextHead" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        android:gravity="center" />

<TextView   android:text="A webcomic of romance, sarcasm, math, and language."
        android:textColor="#000000"
        android:textSize="15dp"
        android:textScaleX="1.1"
        android:id="@+id/TextSub" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:paddingTop="5dp"
        android:paddingBottom="10dp"
        android:gravity="center" />
</LinearLayout>
</ScrollView>

<ScrollView 
 android:scrollbars="horizontal" 
 android:layout_height="match_parent" 
 android:layout_width="wrap_content">

        <ImageView  android:id="@+id/MainImage" 
                    android:layout_width="fill_parent" 
                    android:layout_height="fill_parent"/>


</ScrollView>

</LinearLayout>

Try using the matrix scaleType : 尝试使用矩阵scaleType

<ImageView  android:id="@+id/mainimage" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
            android:src="@drawable/mainimage"
            android:scaleType="matrix"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM