Вопрос по ios, ios5, objective-c – Как использовать пользовательский UINavigationBar

0

Error: User Rate Limit ExceededUINavigationBar.

@interface MyNavigationBar : UINavigationBar

Error: User Rate Limit ExceededNavigationControllerError: User Rate Limit Exceeded

 _navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
 [_window addSubview:[_navigationController view]];
[self.window makeKeyAndVisible];

Error: User Rate Limit ExceedednavigationControllerError: User Rate Limit ExceededMyNavigationBar

Error: User Rate Limit Exceeded

Благодарю.

Ваш Ответ

2   ответа
1

@property(nonatomic, readonly) UINavigationBar *navigationBar

MyNaviagtionBar *myBar = [[MyNavigationBar alloc] init];
_navigationController.navigationBar = mybar;

@class MyNavigationBar;

@interface MyNavigationController : UINavigationController
@property(nonatomic, strong) MyNavigationBar *navigationBar;
@end

@implementation MyNavigationController
@synthesize navigationBar = _navigationBar;
@end

_navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];

_navigationController = [[MyNavigationController alloc] initWithRootViewController:self.viewController];
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded Streetboy
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded Streetboy
4

UINavaigationControllernavigationBarUINavigationBar.

enter image description here

@interface UINavigationController (DSCNavigationController)

+ (UINavigationController *)dsc_navigationControllerWithRootViewController:(UIViewController *)rootViewController;

@end

@implementation UINavigationController (DSCNavigationController)

+ (UINavigationController *)dsc_navigationControllerWithRootViewController:(UIViewController *)rootViewController;
{
    NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"DSCNavigationController" owner:nil options:nil];

    NSAssert(1 == [topLevelObjects count], @"DSCNavigationController should have one top level object");

    UINavigationController *navigationController = [topLevelObjects objectAtIndex:0];

    NSAssert([navigationController isKindOfClass:[UINavigationController class]], @"Should have a UINavigationController");

    [navigationController pushViewController:rootViewController animated:NO];

    return navigationController;
}

@end

#import "UINavigationController+DSCNavigationController"

MyViewController *myViewController = [[MyViewController  alloc] init];
UINavigationController *navigationController = [UINavigationController dsc_navigationControllerWithRootViewController:myViewController];
Error: User Rate Limit Exceeded
Error: User Rate Limit ExceededNSLog(@"%@", self.navigationController);Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded Streetboy

Похожие вопросы