I got the problem with ImageView position after I load picture. On the beginning when I lunch the application I have sample picture in ImageView, then after choosing another one from gallery, the old one is replacing by new and unluckily the imageView changes position in the same moment. How to block it ? How to make ImageView be at this same position for all the time?
This is my xaml code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<EditText
android:id="@+id/add_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="66dp"
android:ems="10"
android:hint="add name of product"
android:inputType="textPersonName" />
<TextView
android:id="@+id/prod_show_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Name of Product"
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:id="@+id/add_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/prod_show_description"
android:layout_marginTop="31dp"
android:ems="10"
android:hint="here put the description of product "
android:inputType="textMultiLine" />
<TextView
android:id="@+id/prod_show_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/add_name"
android:layout_marginTop="31dp"
android:text="Description Of Product "
android:textAppearance="?android:attr/textAppearanceLarge" />
<ImageView
android:id="@+id/add_picture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/prod_show_description"
android:layout_below="@+id/add_description"
android:layout_marginRight="22dp"
android:layout_marginTop="45dp"
android:maxHeight="120dp"
android:maxWidth="120dp"
android:minHeight="120dp"
android:minWidth="120dp"
android:scaleType="centerInside"
android:src="@drawable/sample" >
</ImageView>
<Button
android:id="@+id/add_addpicture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/add_picture"
android:layout_marginRight="141dp"
android:minHeight="80dp"
android:onClick="AddPicture"
android:text="Add Picture " />
<Button
android:id="@+id/add_addingbut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/add_picture"
android:layout_marginTop="119dp"
android:onClick="AddTheProductMethod"
android:text="Add the product" />