daily pastebin goal
11%
SHARE
TWEET

Untitled

a guest Aug 14th, 2018 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top