ios - Automatically move UIView with Constraints -
I have some expandable views that are in UIScrollView and when they are expanded, I need all those views Is expanded view expanded.
What do I have to do: (Left start position, right after changing frame)
What's actually happening:
Many other ideas also need to move forward so that there is a certain place below the yellow look. I believe (hopefully) if I spread the blue color then you can get a yellow view to go down, this will increase as much.
I see What is an easy way to do this with obstacles, for which a significant amount of code will not be required? I am not quite able to understand it. Below is the code that I used recently, the same purpose, } blueView.frame = newFrame; Where there is only one big height in the new frame.
- (zero) viewDidoadload {[Super Viewedload]; _ Expandable View = [[UIView alloc] init]; _adjacentView = [[UIView alloc] init]; [_ Expandable view setback color color: [UIColor redColor]]; [_scrollView addSubview: _expandableView]; _ Expandable view TranslatableAutorizingMaskIntension = No; [_adjacentViewSetBackGram Color: [UIColor blueColor]]; [_scrollViewSubview: _adjacentView]; _adjacentView.translatesAutoresizingMaskIntoConstraints = No; NSArray * constraints = zero; NSDictionary * Visual = NSDictionaryOfVariableBindings (_expandableView, _adjacentView); Barriers = [NSLayoutConstraint constraintsWithVisualFormat: @ "V: | - [_ expandableView] -10 - [_Viewed View (== 20)] - |" Option: 0 metric: zero view: view]; [_scrollView addConstraints: Obstacles]; Barriers = [NSLayoutConstraint constraintsWithVisualFormat: @ "V: [_ expandableView (== 20)]" Options: 0 metric: zero views: view]; Height Moderate = [Obstacles Previous Object]; [_scrollView addConstraints: Obstacles]; Obstacles = [NSLut Contentant Barriers Different Format: @ "H: | - [_ Expandable View (== 800)] - |" Option: 0 metric: zero view: view]; [_scrollView addConstraints: Obstacles]; Obstacles = [Various formats with NSLut content restrictions: @ "H: | - [_ Strong View (== 800)] - |" Option: 0 metric: zero view: view]; [_scrollView addConstraints: Obstacles];
- (IBAction) extension action: (ID) sender {heightConstraint.constant = heightConstraint.constant + 20; }
Comments
Post a Comment