0

i'm working on an app, it loads the photo from the gallery( the photo is taken from device camera), and do other app relevant features and save, the problem i'm facing is that the image which loads compress vertically and horizontally which makes the image shrink, which is not required i'm using the following code for xml file

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="bottom"
    android:orientation="vertical" >

    <FrameLayout
        android:id="@+id/frame"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/previous_btn"
        android:layout_weight="0.88" >

        <ImageView
            android:id="@+id/imageView"
            android:layout_width="fill_parent"
            android:layout_height="match_parent"
            android:scaleType="matrix" />
    </FrameLayout>

    <Button
        android:id="@+id/previous_btn"
        android:layout_width="100dip"
        android:layout_height="wrap_content"
        android:text="Previous" />

    <Button
        android:id="@+id/next_btn"
        android:layout_width="100dip"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/previous_btn"
        android:text="Next" />

    <Button
        android:id="@+id/button"
        android:layout_width="100dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_toRightOf="@+id/next_btn"
        android:text="Save Picture" />

</RelativeLayout>

Help me please to solve this issue!!! Best regards

Numair
  • 1,062
  • 1
  • 20
  • 41

1 Answers1

1

Well your FrameLayout is set to wrap_content for height, and the ImageView is set to match_parent on height. So that's sorta contradictory. Haha. And I'm not sure how you're using weights in a relative layout. Unless that's leftover from when you used a LinearLayout. And your previous_btn has no location in the relativelayout set.

Brayden
  • 521
  • 1
  • 5
  • 17