0
我恢復了我的項目,得到了以下storybard導航條只出現第1頁,其他不再出現
而且在CollectionViewController我有以下的代碼,我的問題是,當我打電話其他頁面,導航欄自敗
<pre> - (void)viewDidLoad {
[super viewDidLoad];
//navigation bar
UIImage *image = [UIImage imageNamed:@"home.png"];
UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
backButton.frame = CGRectMake(0, 0, 50, 50);
[backButton setImage:image forState:UIControlStateNormal];
UIBarButtonItem *button2 = [[UIBarButtonItem alloc] initWithCustomView:backButton];
self.navigationItem.leftBarButtonItem = button2;
self.title = @"Welcome User";
marrImages=[[NSMutableArray alloc]init];
mdictImageData=[[NSMutableDictionary alloc]initWithObjectsAndKeys:@"circlshadow_parking.png",@"imageFile",@"Parking",@"Info",nil];
[marrImages addObject:mdictImageData];
}
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[self navigationController] setNavigationBarHidden:NO animated:YES];
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
NSUInteger lastIndex = [indexPath indexAtPosition:[indexPath length] - 1];
if(lastIndex == 0)
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *myVC = (UIViewController *)[storyboard instantiateViewControllerWithIdentifier:@"ParkingMenu"];
myVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:myVC animated:YES];
}
}<code>
我們展示你的故事板。向我們展示屏幕截圖。告訴我們你如何從一個頁面移動到另一個頁面。告訴我們你是如何「回家」的。 – jcaron
我的故事板是http://s30.postimg.org/srmobz201/Captura_de_Tela_2015_12_07_s_16_18_05.png,我打電話給這樣的頁面:UIStoryboard * mainStoryboard = [UIStoryboard storyboardWithName:@「Main」bundle:nil]; UIViewController * vc = [mainStoryboard instantiateViewControllerWithIdentifier:@「ParkingMenu」]; [self presentViewController:vc animated:YES completion:NULL];因爲我有一個集合視圖控制器 – HideCode
請編輯您的問題以添加詳細信息。 – jcaron