46548

Effect like deletion in ios

Question:

I need hint/code like deletion/move app effect on iOS, normally i have started the code, I am using UIButton list in UIScroll.

So my question is that supposes I have 8 to 10 button in screen and i want to change their position with dragging. for example choose 6th button and move or set to between 1 and 2. when I put them in to between the position of other button will change.

I am using UIPanGestureRecognizer for dragging.

Answer1:

download, <a href="http://undefinedvalue.com/sites/undefinedvalue.com/files/Tiles-v1.0.zip" rel="nofollow">Tiles-v1.0.zip</a>, and check code, this is what i used when i needed to implement that.

reference: <a href="https://stackoverflow.com/questions/1535057/move-uiviews-to-avoid-collision-like-rearranging-icons-on-springboard" rel="nofollow">Move UIViews to avoid collision like rearranging icons on Springboard</a>

Answer2:

If you already have the code for dragging, the rest is easy. Just use UIView Animation.

[UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.3]; ... [button setFrame:newFrame]; ... [UIView commitAnimations];

Basically, just move your buttons to the their new positions in that beginAnimations - commitAnimations block.

Hope this helps.

Recommend

  • Mouse event in Java
  • What exactly does getSubimage() of BufferedImage do?
  • jQueryUI Draggable: Constrain draggability to a single axis?
  • Disable globe movement on click in World Wind
  • Aspect advising other aspects
  • Can't get LogCat (Alcatel OneTouch Evolve)
  • Defining variable by logical subseting on time interval in data.table
  • Partial specialization of a class template in derived class affects base class
  • CoreData basics – to-many relationship array data
  • Eloquent Relationship on Partial Match
  • Uber API - requests endpoint cannot read read json
  • Unable to play media with vlc ocx
  • Embedded Google Maps in Rails not responsive
  • XMLBeans Duplicate Class and Class Not Found Errors
  • Is it possible to define rest argument in OCaml?
  • SyntaxError: (irb):26: both block arg and actual block given
  • Application level floating views with navigation in Android
  • How do I display a dialog that asks the user multi-choice questıon using tkInter?
  • AndEngine Applying Transparancy to AndEngine View
  • Using a canvas object in a thread to do simple animations - Java
  • Eclipse CDT error: Unable to compile
  • How to add git credentials to the build so it would be able to be used within a shell code?
  • Blackberry - Custom EditField Cursor
  • java inputstream
  • Avoid links criss cross / overlap in d3.js using force layout
  • Scrapy recursive link crawler
  • Body moving without any force applied? (Box2d)
  • How to rebase a series of branches?
  • Why HTML5 Canvas with a larger size stretch a drawn line?
  • Calling of Constructors in a Java
  • Numpy divide by zero. Why?
  • Traverse Array and Display in markup
  • Transpose CSV data with awk (pivot transformation)
  • Why can't I rebase on to an ancestor of source changesets if on a different branch?
  • How to set the response of a form post action to a iframe source?
  • Change div Background jquery
  • Android Google Maps API OnLocationChanged only called once
  • Qt: Run a script BEFORE make
  • reshape alternating columns in less time and using less memory
  • Converting MP3 duration time