ios - Keep UIButton Size the same when activated multiple times -
i have uibutton constraints set width , height 80 80. when press uibutton activate uiscrollview menu, constraints changes , button looks image below. (the button blue oval shape @ bottom of screen)
here's viewwcontroller.m codes uibutton , uiscrollview animations.
#import "viewcontroller.h" @interface viewcontroller () @end @implementation viewcontroller @synthesize scrollview; - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. draw1 = 0; scrollview.frame = cgrectmake(0, 300, 480, 55); [scrollview setcontentsize:cgsizemake(480, 55)]; openmenu.frame = cgrectmake(220, 270, 60, 30); } - (void)viewdidappear:(bool)animated { [super viewdidappear:animated]; draw1 = 1; } - (ibaction)openmenu:(id)sender { if (draw1 ==0) { draw1 = 1; [uiview animatewithduration:0.5 delay:0.0 options: uiviewanimationoptioncurveeaseout animations:^{ scrollview.frame = cgrectmake(0, 1000, 568, 200); openmenu.layer.frame = cgrectmake(self.view.center.x - 30, self.view.frame.size.height - 80, 60, 30); } completion:^(bool finished){ nslog(@"done!"); }]; } else { draw1 = 0; [uiview animatewithduration:0.5 delay:0.0 options: uiviewanimationoptioncurveeaseout animations:^{ scrollview.frame = cgrectmake(0, 300, 568, 200); openmenu.layer.frame = cgrectmake(self.view.center.x - 30, 270, 60, 30); } completion:^(bool finished){ nslog(@"done!"); }]; } } @end
how can make button constraints says 80 80 , doesn't change when activated?
please check selected image. guess size on 80-80. or maybe, height > width.
Comments
Post a Comment