- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
@implementation SlideMenuNavigationBar
- (void)layoutSubviews
{
[super layoutSubviews];
for (UIView *aView in self.subviews) {
// Correcting menu toggle button position
if ([[aView.class description] isEqualToString:@"UIButton"] && aView.frame.origin.x < self.frame.size.width/2) {
CGRect frame = aView.frame;
frame.origin.x = 12; // 8 for correlation
frame.origin.y = -1; // 1 for correlation
aView.frame = frame;
}
if (aView.frame.origin.x > self.frame.size.width/2 && !isIPad && ![[aView.class description] isEqualToString:@"ColoredView"]) {
CGRect frame = aView.frame;
frame.origin.x = 260; // 8 for correlation
frame.origin.y = -1; // 1 for correlation
aView.frame = frame;
}
// Correcting back button and right button positions
if ([[aView.class description] isEqualToString:@"_UINavigationBarBackIndicatorView"]) {
CGRect frame = aView.frame;
frame.origin.y = [self.class navigationBarHeight] - kDefaultNavigationBarHeight + 5; // 5 for correlation
aView.frame = frame;
}
if ([[aView.class description] isEqualToString:@"UINavigationButton"]) {
CGRect frame = aView.frame;
frame.origin.y = [self.class navigationBarHeight] - kDefaultNavigationBarHeight + 2; // 2 for correlation
aView.frame = frame;
}
if ([aView isKindOfClass:[NavigationBarButton class]]) {
CGRect frame = aView.frame;
frame.origin.x = 278; // 8 for correlation
frame.origin.y = 6; // 1 for correlation
aView.frame = frame;
}
}
}
@end
guest 11.11.2014 22:16 # +1
guest 11.11.2014 22:58 # +2
hack2root 12.11.2014 15:49 # 0
Анонимус 12.11.2014 23:38 # +1
Psionic 14.11.2014 12:01 # +1
умесьтен.
DypHuu_niBEHb 02.11.2019 03:18 # 0
>isEqualToString:@"UIButton"]
тут
> frame.origin.x = 278;