每次我的相机预览屏幕加载时,我都会出现下面的叠加层。我想在程序上命名为"已完成"的叠加层上创建一个圆形矩形按钮。我该怎么做?
- (UIView*)CommomOverlay {
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;
[view addSubview:FrameImg];
return view;
}
另外,我会在finishButtonPressed
方法中添加什么来显示名为testviewcontroller
的笔尖的视图?
答案 0 :(得分:1)
1。)这是添加到视图中心的蓝色按钮:
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;
[view addSubview:FrameImg];
UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 150, 50)];
button.center = view.center;
button.backgroundColor = [UIColor blueColor];
button.layer.cornerRadius = 10.0;
button.titleLabel.text = @"Finished";
[view addSubview:button];
2。)你应该: