Guest User

Untitled

a guest
Aug 14th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. Override layoutSubviews to call [super layoutSubviews] and then find and reposition the button's view
  2. - (void) layoutSubviews
  3. {
  4.  
  5.  
  6. }
  7.  
  8. call [super layoutSubviews] and then find and reposition the button's view.
  9.  
  10. - (void) layoutSubviews
  11. {
  12. [super layoutSubviews];
  13.  
  14. for (UIView *view in self.subviews) { // Go through all subviews
  15. if (view == buttonYouWant) { // Find the button you want
  16. view.frame = CGRectOffset(view.frame, 0, -5); // Move it
  17. }
  18. }
  19. }
  20.  
  21. -(void)layoutSubviews {
  22. [super layoutSubviews];
  23. for (UIView *view in self.subviews) {
  24. if ([view isKindOfClass:NSClassFromString(@"TheClassNameYouWant")]) {
  25. // Do whatever you want with view here
  26. }
  27. }
  28. }
Add Comment
Please, Sign In to add comment