0
我有一張圖片(UIImageView)和按鈕(UIButton)。如何將UIImageView添加到QuickDialog中的Qsection?
在此視圖中,我使用QuickDialogController,因爲它在此視圖中具有許多快速對話框元素。
我想在此視圖的Section(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];
}
謝謝。