ios - Custom logo and button not appear in UINavigationBar -
I have a UINavigarionController and I want to add custom background and logo and add the left button in the navigation bar I can add background But my logo and button do not appear, would you please help me, thank you in advance!
Your code worked and I am receiving logos and buttons, but with a change
UIButton * button = [UIButton buttonWithType: UIButtonTypeCustom]; [Set button image: [UIImage imageNamed: @ "menu.png"] forState: UIControlStateNormal]; // [button addTarget: self-acting: control event for @Selector: UIControlEventTouchUpInside]; [Button Set Frame: CGRactMake (0, 0, 25, 25)]; UIBarButtonItem * rightButton = [[UIBarButtonItem alloc] initWithCustomView: button]; Self.navigationItem.rightBarButtonItem = rightButton; UIImageView * Navigation Image = [[UIImageView alloc] initWithFrame: CGRectMake (0, 0, 120, 30)]; Navigation Image. Dimension = [UIImage imageNamed: @ "menu.png"]; UIImageView * workaroundImageView = [[UIImageView alloc] initWithFrame: CGRectMake (0, 0, 120, 30)]; [WorkaroundImageView addSubview: Navigation Image]; Self.navigationItem.titleView = Action Image; Self.navigationItem.titleView = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @ "menu.png"]]; Just specify the image type i.e. do not do the menu as menu. And by deleting the UI controller for your Navigation ID, you wish to greet the class above and share your results
Comments
Post a Comment