カメラにアクセスするたびに読み込まれるボタンをオーバーレイに作成しました。ボタンは正常に応答し、セレクターに問題があるかどうかを確認するためにテストしました。私は100%セレクターに問題はありません(NSLog文字列に応答しました)。
押すたびに新しいビューを表示したいのですが、いろいろな方法を使っても何もしません。私はここでアイデアを使い果たしています、私は多くの方法を試しましたが、どれもうまくいきません、そして私は何も意味しません。フレームワークを正しくインポートしたことを確認しました。新しいプロジェクトを作成し、ステップ1からすべてをやり直して、元のプロジェクトに問題がないことを確認しました。
}
- (UIView*)CommomOverlay {
//Both of the 428 values stretch the overlay bottom to top for overlay function. It
doesn't cover it.
UIView* view = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,430)];
UIImageView *FrameImg = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,430)];
[FrameImg setImage:[UIImage imageNamed:@"newGraphicOverlay.png"]];
FrameImg.userInteractionEnabled = YES;
UIButton *myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
myButton.frame = CGRectMake(20, 20, 200, 44); // position in the parent view and set the
size of the button
[myButton setTitle:@"Click Me!" forState:UIControlStateNormal];
// add targets and actions
[myButton addTarget:self action:@selector(buttonPressed)
forControlEvents:UIControlEventTouchUpInside];
[view addSubview:FrameImg];
[view addSubview:myButton];
return view;
}
以下は私の-(void)buttonPressedメソッドでは機能しません:
UIViewController *viewControllerName = [[UIViewController alloc] initWithNibName:
(NSString *) bundle:(NSBundle *)];