2012-11-25 230 views
1

enter image description here所以我在我的應用程序中有一個UIActivityViewController。如何更改背景顏色。 而且我也很快如何添加Facebook和Twitter到我的UIActivityViewControllerUIActivityViewController背景顏色

驗證碼:

- (IBAction)Social:(id)sender { 
      UIActivityViewController *social = [[UIActivityViewController alloc]initWithActivityItems:[NSArray arrayWithObjects:@"Travel+ Rocks",nil] applicationActivities:nil]; 
      social.excludedActivityTypes = @[UIActivityTypeCopyToPasteboard,UIActivityTypeAssignToContact,UIActivityTypePostToWeibo,UIActivityTypePrint]; 
      [self presentViewController:social animated:YES completion:nil]; 
      [social setCompletionHandler:^(NSString *activityType, BOOL completed) 
      { 
       NSLog(@"Activity = %@",activityType); 
       NSLog(@"Completed Status = %d",completed); 

       if (completed) 
       { 
        // UIAlertView *objalert = [[UIAlertView alloc]initWithTitle:@"Alert" message:@"Your Posts were sucessful" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
        // [objalert show]; 
        // objalert = nil; 
       }else 
       { 
        // UIAlertView *objalert = [[UIAlertView alloc]initWithTitle:@"Alert" message:@"Your Posts weren't sucessful" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
        // [objalert show]; 
        // objalert = nil; 



       } 
      }]; 
     } 

這件代碼的修復背景Eror:

NSString *message = [NSString stringWithFormat:@""]; 
    NSString *textToShare = message; 
    UIImage *imageToShare = [UIImage imageNamed:@""]; 
    NSArray *activityItems = [[NSArray alloc] initWithObjects:textToShare, imageToShare,nil]; 
    UIActivity *activity = [[UIActivity alloc] init]; 
    NSArray *applicationActivities = [[NSArray alloc] initWithObjects:activity, nil]; 
    UIActivityViewController *activityVC = 
    [[UIActivityViewController alloc] initWithActivityItems:activityItems 
    applicationActivities:applicationActivities]; 
    [self presentViewController:activityVC animated:YES completion:nil]; 

回答

0

如果您設置了目標 - >摘要 - >狀態欄樣式,則會顯示共享視圖的顏色。 ,最好IV發現.....

enter image description here

希望它有助於