ios - UILabel animating improperly -
For some reason, the text of the UILB wants to set its alignment without animation, and I can not understand that the text How to live with the rest of the label
I now have the following code:
UILabel * label = [[UILabel alloc] initWithFrame: CGRactem (40,200,100,50)]; [Label set text: @ "label name"]; [Label setbackgram color: [UIColor blueColor]]; [Label set font: [UIFont systemFontOfSize: 17.0]]; [Label settextcroller: [UIColor blackcolor]]; [Label settextlegalism: nstextAlignmentCenter]; [Self.view addSubview: label]; [UIView Chetanvishvik: 3 Animation: ^ {[Label setframe: CGRactam (40,200,200,300)]; }]; This code is called in the action mode of the button. Generally the animation will be different from the label's creation, but I keep it in the same method for testing.
For some reason when it moves, the label is completely changed because it is considered and I can change the size of the frame, though the text aligns itself in the horizontal axis. Which will be at the end of the animation in the vertical axis, however, it is properly animated.
Just looks like this animation:
For some reason, the text of the label is focused on moving up and down but the focus is not left-handed, as I used to assume that it should be.
I have seen everyone and there is no solution on this. Does anyone know if UILabels behave this way and if there is any way around it?
You can add UIView and then add the UILB as its subviews:
UIView * view = [[UIView alloc] initWithFrame: CGRectMake (40, 20, 100, 50)]; [Set viewback color: [UIColor blueColor]]; [Self.view addSubview: view]; UILBL * Labels = [[UILBL Alloc] Init]; [Label set text: @ "label name"]; [Label setbackgram color: [UIColor clearColor]]; [Label set font: [UIFont systemFontOfSize: 17.0]]; [Label settextcroller: [UIColor blackcolor]]; [Label settextlegalism: nstextAlignmentCenter]; [Label size tofitt]; [Label set off offline: 0]; [Label set frame: CGRectOffset (label.frame, (see .frame size.width - label.frame.size.width) / 2, (see .frame.height - label.frame.size.height) / 2) ]; [Adviewview: label] see; [UIView Animation: 3 Animation: ^ {[Set Set Frame: CGRactack (40, 20, 200, 300)]; [Label Set Frame: CGRactMake ((view.frame.size.width - label.frame.size.width) / 2, (see .frame.height - label.frame.size.height) / 2, label.frame. Size.width, label.frame.size.height)]; } Closing: ^ (BOOL Finish) {}];
Comments
Post a Comment