现在我使用[self.navigationController setNavigationBarHidden:NO animated:YES];
导航栏从右到左飞,有没有办法从上到下放下它?
我在ARC中使用自定义委托类时遇到了一个奇怪的问题.在viewDidLad之后的viewcontroller中,我调用工具栏setDelegate方法并将viewcontroller指定为委托.
每当我尝试引用委托时,它都是零,即使在viewcontroller中设置之后也是如此.
//MPToolbar.h
#import <UIKit/UIKit.h>
//Define the protocol for the delegate
@class MPToolBar;
@protocol MPToolBarDelegate <NSObject>
@required
- (void)writeButtonSelected;
- (void)writeButtonDeSelected;
@end
@interface MPToolBar : UIView{
id <MPToolBarDelegate> delegate;
}
@property(strong) UIButton *lastButton;
@property(strong) id <MPToolBarDelegate> delegate;
-(IBAction)buttonSelected:(id)sender;
-(void)resizeForOrientation:(UIInterfaceOrientation)orientation;
@end
//MPToolbar.m
#import "MPToolBar.h"
@implementation MPToolBar
@synthesize lastButton, delegate;
- (id)initWithFrame:(CGRect)frame
{
if ((self = [super initWithFrame:frame])) {
// Initialization code
}
NSArray *nibViews = [[NSBundle mainBundle] loadNibNamed:@"MPToolBar" owner:self options:nil];
[self addSubview:[nibViews objectAtIndex:0]];
return self;
}
#pragma button actions
-(IBAction)buttonSelected:(id)sender{
UIButton …Run Code Online (Sandbox Code Playgroud)