Pergunta

I have a uiview that contains other custom drawn uiview inside it. Now I want that, when a user clicks this parent view it would expand to a new defined frame with animation. I had some success using the animation block. The problem is that the expanded view is just the scaled version of the unexpanded uiview and hence it is a little pixelated. By calling the child views setneedsdisplay() after the animation block now the end result of expanding the view is sharp( i.e. not pixelated). But in transitions it still pixelated.

Can someone suggest a better way to do this?

Foi útil?

Solução

This is an old question, but I'll give it a shot anyway...

By calling the child views setneedsdisplay() after the animation block now the end result of expanding the view is sharp( i.e. not pixelated)...Can someone suggest a better way to do this?

One way that you could have done this in Xcode 4.2 is to insert an image view containing a picture of the larger version of the view. You could create that picture by rendering the view in an image context. This approach will work best, of course, if the animation expands the view by simply scaling it; if you're moving subviews around during the animation, a static image obviously won't be helpful.

Now that Xcode 4.2 is largely a distant memory and devices have a lot more horsepower, using autolayout constraints to manage the sizes and positions of subviews during the expansion should yield pretty good results.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top