我有一张图片(UIImageView)和按钮(UIButton)。
在这个视图中我使用 QuickDialogController 因为它在这个视图中有很多快速对话框的元素。
我想在此视图的部分(QSection)中添加图片(UIImageView)和按钮(UIButton)。
如何添加它。
这是我的示例代码。
// test Add Image
-(void) addImageView
{
image = [[UIImageView alloc] initWithFrame:CGRectMake(35, 60, 250, 250)];
[image setImage:[UIImage imageNamed:@"image.jpg"]];
[image setContentMode:UIViewContentModeScaleAspectFit];
[self.view addSubview:image];
}
// test Add Button
-(void) addRotateButton
{
button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button.frame = CGRectMake(125, 350, 70, 40);
button.backgroundColor = [UIColor lightGrayColor];
[button setTitle:@"Rotate" forState:UIControlStateNormal];
[button addTarget:self action:@selector(onRotateButtonClicked:) forControlEvents:UIControlEventTouchDown];
[self.view addSubview:button];
}
谢谢你。