imageview resizing while dragging a image in layout in android

I am creating an android application in which i need to drag imageview. i tried using layout params and its moving fine but when the image moves nearby right and bottom corner of device then imageview became resizing. i dont know why this happens. my code is below what i tried.

if (me.getAction() == MotionEvent.ACTION_MOVE) { drag=true; if(drag){ int x=(int) (me.getRawX()); int y=(int) (me.getRawY()); innerlayout.setLayoutParams(new RelativeLayout.LayoutParams(innerlayout.getLayoutParams().width, innerlayout.getLayoutParams().height)); LayoutParams params = (LayoutParams) innerlayout.getLayoutParams(); params.leftMargin = x-25; params.topMargin = y-75; innerlayout.setLayoutParams(params); } } else if(me.getAction() == MotionEvent.ACTION_UP) { drag=false; } return true; } });

-------------Problems Reply------------

look at this Moving Images on the Screen with Android

How to use Multi-touch in Android 2: Part 6, Implementing the Pinch Zoom Gesture

Category:android Views:1 Time:2011-09-17

Related post

  • drag and drop across layouts in android 2011-09-20

    I have one linear layout(I'll call it child) and one relative layout inside one linear layout. I want to drag and drop items from the relative layout to the child linear layout How can I do this? I am not able to drag and drop between layouts -------

  • How to resize the RelativeLayout or any other Layout in Android? 2010-04-13

    I have a RelativeLayout defined in xml and I call the setContentView(R.layout.relativeLAyout) for displaying in Activity. Now, if I want to resize this RelativeLayout then can it be done and if yes, then can someone let me know how? The inner compone

  • Prevent Image in ImageView from being resized when dragged out of RelativeLayout 2013-02-14

    I didn't find the answer to my question in the other topics. I have an ImageView with a background drawable. This ImageView has an onTouchListener on it and one can drag it around. I now want to add an ImageResource to this view (together with a padd

  • Resize and drag Image 2010-01-02

    Can anyone suggest the script for Image Resize with drag? But I want the script with the handles associated with Image so we can resize and drag Image. (Like Div Resizing). Thanks... --------------Solutions------------- set the image height 100% and

  • Resize,Clone,Drag/Drop and rotate image using Jquery & Javascript 2010-09-21

    HI All, I want to achieve the Resize,Clone,Drag/Drop and rotate functionality on an image seleted by the user.I am able to do all these in separate function ,but couldn't incorporate in single function. Since the images are dynamically created,i need

  • Drag and Drop UI layouts using jQuery 2011-02-17

    For our next project (a small app in ASP.NET/C#) we have to create drag and drop zones in the UI so that components/widgets can be dragged and dropped and layouts can be changed dynamically (for example, the user should be able to switch between two-

  • Resize and drag issues with jQuery dialog over iFrame 2011-08-18

    I am using jQuery dialogs over an iframe in my webpage and the resizing and dragging does not work as expected. What it does, is it stops working when your mouse gets outside of the window, which is quite annoying because it happens really fast. This

  • Should i resize the bitmap before adding to a ImageView or let the ImageView resize the Bitmap? 2011-09-01

    i have a simple question: Should i resize a bigger bitmap before adding to a ImageView or let the ImageView resize the Bitmap? What's the right way, regarding performance? Thanks --------------Solutions------------- Consider using scale for ImageView

  • Resizing and dragging SVG polygons dynamically 2012-01-20

    I am struggling to find a way for resizing and dragging a svg polygon dynamically with the mouse. Unfortunately jQueryUi does not work for svg elements. I also checked the Raphael library, but cant find any documentation/snippets on how to realize th

  • Is it possible to resize/reposition layouts in android at runtime? 2010-12-02

    I am developing an application in android, in which the UI looks almost similar to igoogle. I wanted to know if I can reposition the layouts in android like how its done igoogle page. Please provide me some sample code if anyone has already done it.

  • how to drag an image by touching in android? 2010-09-08

    This question already has an answer here: Touch and drag image in android 2 answers how to drag an image by touching in android? Please Help me with a sample code. --------------Solutions------------- package com.examples.Touchmoveimage; import andro

  • view at same position in absolute layout in android 2011-09-19

    I have one absolute layout which contains many ImageViews. I have implemented Drog and Drop functions for all imageview. Now what happen when suppose i drag one imageview over another imageview then first view goes back side because it have been adde

  • How to add controls to a Tab Layout in Android? 2010-04-05

    I am following this tutorial and have completed it. Now I would actually like to add you know some controls to these tabs like textboxes(text edit). How do I do this? I g

  • How to add a layout into a layout in android 2010-12-18

    I don't know how to write code to add a layout into a layout in android, because when I read the reference, I saw it only have "AddView" method, when I try to use "AddView" method to add a layout, it don't work. Can you suggest me some solutions, I d

  • How do I obtain the following layout in android 2011-08-04

    I'm trying to obtain the following layout in android: Where in the white space I'm having an imageview.My Image will stretch until the bottom of the screen where I have 2 buttons. I tried with this: <?xml version="1.0" encoding="utf-8"?> <Li

  • For designing dynamic layout in android like the status bar in the home screen 2011-09-14

    How to make a layout in android like the status bar in the home screen which allows the user to drag the status bar up to any height. The layout should also allow the user with a flick up or down to expand or contract the the layout fully. ----------

  • Putting undetermined number of views into a layout in Android 2011-12-11

    If I define a layout using XML, but I want to populate it with some number n, of ImageViews, hwhat is the best way to go about doing this? If I wanted to put in a single IMageView, I could easily put it in the XML of the layout, but if n (the number)

  • Line-breaking widget layout for Android 2009-02-14

    I'm trying to create an activity that presents some data to the user. The data is such that it can be divided into 'words', each being a widget, and sequence of 'words' would form the data ('sentence'?), the ViewGroup widget containing the words. As

  • Possible to use null layout in Android? 2010-03-08

    Is there an equivalent to Java's null layout in Android? Basically I want to specify the x and y coordinates of each component and not have the layout manager choose where they go. They will be within a scroll pane so it doesn't matter whether they f

Copyright (C), All Rights Reserved.

processed in 0.103 (s). 11 q(s)