我試圖創建一個模式視圖,當用戶按下按鈕時彈出。模態視圖具有導航欄,其中地圖視圖爲主視圖。我無法在Interface Builder中進行設置。當我將文件所有者視圖的視圖插口設置爲導航控制器中的視圖時,唯一顯示的是地圖視圖,頂部和底部都有一個灰色空間。導航欄從不出現。這裏有一個它的外觀畫面,以及我的IB窗口的圖像。在界面生成器中使用地圖視圖設置導航控制器
如何讓導航欄正確顯示?由於
alt text http://img.skitch.com/20100126-d5u4yuufpe77xdkuw2k1h9uahf.jpg
以防萬一,這裏的的MapViewController聲明:
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
@interface MapViewController : UIViewController
{}
@end
而推模態視圖控制器代碼:
MapViewController *mapVC = [[MapViewController alloc] init];
self.mapViewController = mapVC;
[mapVC release];
[self presentModalViewController:mapViewController animated:YES];
感謝您的幫助,完美的工作。 – 2010-01-26 23:30:12