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="ce开发者_StackOverflow中文版nter"
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:
<ImageView android:id="@+id/mainimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/mainimage"
android:scaleType="matrix"/>
精彩评论