info:xcode 4.3.2,iOS5,使用storyboard。如何每次點擊特定選項卡時使相機出現?
從xcode的「選項卡式應用程序」模板創建項目。
做的:
@implementation SUSecondViewController
UIImagePickerController *pic;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
pic = [[UIImagePickerController alloc] init];
pic.delegate = self;
// [pic setSourceType:UIImagePickerControllerSourceTypeCamera];
[self presentModalViewController:pic animated:YES];
}
當我點擊選項卡中的第一次,顯示在相機應用。
當我第二次單擊該選項卡時,會顯示模板的默認視圖,但是我希望每次單擊該選項卡時都會顯示攝像機。
我怎樣才能使相機出現每次我點擊一個特定的選項卡(f.ex.相機圖標)?
請參閱我的答案。這應該對你有所幫助。如果您需要更多幫助,請告訴我。 – 2012-03-24 11:25:19