UIButton从UIActivityViewController的邮件取消后不可见

时间:2013-11-20 07:52:20

标签: ios iphone uiactivityviewcontroller

在我的项目中,我在窗口添加了UIButton个。我正在使用UIActivityViewController进行分享。当我取消邮件或邮件时,我的UIButton不可见。

在窗口添加UI按钮:

    UIImage  *tempImage   = [UIImage imageNamed:@"browse_menu.png"];
btn_Browse  = [UIButton buttonWithType:UIButtonTypeCustom];
btn_Browse.frame      = CGRectMake(0.0, self.window.frame.size.height-tempImage.size.height, tempImage.size.width, tempImage.size.height);
//[btn_Browse addTarget:self action:@selector(createCustomView) forControlEvents:UIControlEventTouchDown];
[btn_Browse setBackgroundImage:tempImage forState:UIControlStateNormal];
[btn_Browse addTarget:self action:@selector(browseButtonClicked:) forControlEvents:UIControlEventTouchDown];
btn_Browse.tag = 0;
[self.window addSubview:btn_Browse];

目前UIActivityViewcontroller:

NSString *msg_store=[NSString stringWithFormat:@"HI - %@ ",lbl_name.text];
NSString *msg=[msg_store stringByAppendingString:[NSString stringWithFormat:@"Welocome! %@",app_Url]];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc]initWithActivityItems:[NSArray arrayWithObjects:msg,nil] applicationActivities:nil];
activityViewController.completionHandler = ^(NSString *activityType, BOOL completed){
    NSLog(@"Activity Type selected: %@", activityType);
    if (completed) {
        NSLog(@"Selected activity was performed.");
    } else {
        if (activityType == NULL) {
            NSLog(@"User dismissed the view controller without making a selection.");
        } else {
            NSLog(@"Activity was not performed.");
        }
    }
};
 [self presentViewController:activityViewController animated:YES completion:nil];  

提前致谢

1 个答案:

答案 0 :(得分:0)

在接收到视图已移除的委托致电或取消观看后,请致电[self.window bringSubviewToFront:btn_Browse];