I have a problem with getting image view top and left position.
My image view is set in center of a relative layout.
When I use getleft()
and getTop()
the result for me is 0 and 0.
my layout file is :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rlMain"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:scaleType="center"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
This is really emergency for me.
My issue:
I wrote a code for move and zooming image view and that work correctly but in first click, image view position changing to 0, 0 and I want to get default position for prevent change in first click.