Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7499789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:56:56+00:00 2026-05-29T19:56:56+00:00

I am animating a UIView that contains a graph drawn with CGPath elements myView.frame=CGRectMake(0,0,1024,768);

  • 0

I am animating a UIView that contains a graph drawn with CGPath elements

myView.frame=CGRectMake(0,0,1024,768);
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
myView.frame=CGRectMake(0,0,0,768);
[UIView commitAnimations];

This works fine the first time that I run this block of code, however I am unable to force myView to update when I use it later by using setNeedsDisplay. When I execute the code the animation happens as expected but it always displays the first graph I send it. I’ve confirmed that the correct information is being sent to the view before I update it.
While I was troubleshooting this I set the destination width of myView to 80.
This causes everything to work properly EXCEPT my CGPath drawing seems to be rasterizing (with some graphs the view gets blurry, others the view looks slightly pixellated). There is NO rasterization that happens when the width is set to 0. This leads me to 3 questions:

1) Am I unable to force a view to redraw if it has a zero width (Does it ‘disappear’ when it’s width is 0)?

2) How do I animate this view without rasterizing the content? This only seems to happen when I change the dimensions of the view, not the position or opacity.

3) Why does the content NOT rasterize when I animate to zero width?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:56:58+00:00Added an answer on May 29, 2026 at 7:56 pm

    Since a zero-width view has no area, it’s not surprising that it doesn’t want to draw itself.

    When you change the size of a view, the view uses its contentMode property to decide how to redraw its contents. The default value of contentMode is UIViewContentModeScaleToFit, which means that it simply scales its previous contents to fit the new size. Try setting the view’s contentMode property to UIViewContentModeRedraw. This tells it to send itself setNeedsDisplay when it is resized.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIView that contains a couple UIButtons that I am animating from
I'm animating a UIView's frame property using a CAKeyframeAnimation on the view's CALayer and
I want it to be animated so I'm using [UIView beginAnimations] I've tried animating
I have a animation in my navigationbased application. [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.5]; [UIView
I was wondering how animations work in Cocoa Touch. For example: [UIView beginAnimations:nil context:nil];
Hi I have a UIView which contains several buttons that are designed by others
I would to resize a UITableView and slide up a UIView that contains a
On simulation, after i load the UIView that contains 52 UIImageView; it takes at
I have a UIView instance that I am animating using CAKeyframeAnimation . It is
I am animating a UIView along a circle using a CAKeyframeAnimation that follows a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.