C++ 使用自定义UIAlertView xCode-包括对话框/文本?

C++ 使用自定义UIAlertView xCode-包括对话框/文本?,c++,cocoa-touch,uialertview,C++,Cocoa Touch,Uialertview,因此,我一直在寻找一种很好的方法,在iOS 8的UIAlertViews中包含图像和其他内容 我最终找到了,它使用了一些人友好上传的Github 它工作得很好,看起来很神奇,但我不确定你是如何在警报中包含对话框或文本的,或者你是如何给它一个标题的(如果可能的话) 有很多代码需要查看,所以可能我只是缺少了它,但这是我的iAction,它在警报中包含了一张图片,显示了它。。。如何包含标题、文本或两者 - (IBAction)TestButton:(id)sender { CustomIOSA

因此,我一直在寻找一种很好的方法,在iOS 8的
UIAlertViews
中包含图像和其他内容

我最终找到了,它使用了一些人友好上传的Github

它工作得很好,看起来很神奇,但我不确定你是如何在警报中包含对话框或文本的,或者你是如何给它一个标题的(如果可能的话)

有很多代码需要查看,所以可能我只是缺少了它,但这是我的
iAction
,它在警报中包含了一张图片,
显示了它。。。如何包含标题、文本或两者

- (IBAction)TestButton:(id)sender {
    CustomIOSAlertView *alertView = [[CustomIOSAlertView alloc] init];
    [alertView setContainerView:[self createDemoView:@"testImage.png"]];
    [alertView setButtonTitles:[NSMutableArray arrayWithObjects:@"Done", nil]];
    [alertView setDelegate:self];
    [alertView setOnButtonTouchUpInside:^(CustomIOSAlertView *alertView, int buttonIndex) { [alertView close]; }];
    [alertView setUseMotionEffects:true];
    [alertView setAlpha:0.90];
    [alertView show];
}

希望你们在这门课上有一些经验,可以帮助我加入一些文本:D

所以在晚上睡觉后,我发布了添加文本的简单方法。 您所做的一切,不是为图像添加UIImageView,而是添加UITextView并为您想要的位置设置坐标。在我的例子中,在UIImageView下面,然后添加为子视图

//include Text
UITextView *textViewContent = [[UITextView alloc] initWithFrame:CGRectMake(70, 200, 200, 110)];
textViewContent.text = @"My Text Here";
textViewContent.backgroundColor = nil;
[demoView addSubview:textViewContent];