• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
iPhone: animating UILabel width results in pre-stretched text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

iPhone: animating UILabel width results in pre-stretched text


  • Subject: iPhone: animating UILabel width results in pre-stretched text
  • From: Rick Mann <email@hidden>
  • Date: Fri, 18 Mar 2011 17:20:54 -0700

I have a table view that allows swipe-to-delete. When the delete button comes up, I want to shrink the UILabels in the custom cell to make room for the button.

So I implement -[tableView:willBeginEditingRowAtIndexPath:] and set up an animation that shrinks a view that contains my labels. All the subviews have frame bindings set up, and they shrink correctly.

The problem is that the text within the UILabels is pre-rendered at the new (narrower) size. The resulting image is then scaled to match the current (wider) size, and as everything animates, it shrinks to be the correct size.

The result is visually very unappealing: the text snaps to a larger (often truncated) look, then animates into place.

The reverse happens when widening if the delete operation is canceled.

Here's a movie showing what I'm talking about:

	http://roderickmann.org/stuff/TextResize.mov

I tried setting the text content mode to "redraw," but that had no effect.

Any way to get it to re-render the text throughout the animation?

Looking closely at what Mail does, I see it replaces the wider view with the narrower version with a crossfade animation.

--
Rick

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: iPhone: animating UILabel width results in pre-stretched text
      • From: David Duncan <email@hidden>
  • Prev by Date: Re: Releasing memory allocated by CoreData's _PFAllocateObjects function?
  • Next by Date: Re: iPhone: animating UILabel width results in pre-stretched text
  • Previous by thread: Splitting a single Core Data model between several files
  • Next by thread: Re: iPhone: animating UILabel width results in pre-stretched text
  • Index(es):
    • Date
    • Thread