Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improvements to Demo's "animate changes" logic.

  • Loading branch information...
commit 903e0652debd554fa7885bd6344858ab2ae76090 1 parent 2108af0
@charlesmchen authored
View
18 WeViewsDemo/Classes/SelectionView.m
@@ -308,13 +308,17 @@ - (void) animateRelayout:(UIView*) view {
dstFrames[i] = view.frame;
// Restore old frame.
- CGRect restoreFrame = view.frame;
- restoreFrame.origin = srcFrames[i].origin;
- if ([views respondsToSelector:@selector(setFrameWithoutLayout:)]) {
- WePanel* frame = (WePanel*) view;
- [frame setFrameWithoutLayout:restoreFrame];
- } else {
- view.frame = restoreFrame;
+ if ([view.subviews count] < 1) {
+ view.frame = srcFrames[i];
+ } else {
+ CGRect restoreFrame = view.frame;
+ restoreFrame.origin = srcFrames[i].origin;
+ if ([views respondsToSelector:@selector(setFrameWithoutLayout:)]) {
+ WePanel* frame = (WePanel*) view;
+ [frame setFrameWithoutLayout:restoreFrame];
+ } else {
+ view.frame = restoreFrame;
+ }
}
// if ([views isKindOfClass:[WePanel class]]) {
View
BIN  ...iewsDemo.xcodeproj/project.xcworkspace/xcuserdata/charleschen.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.