簡體   English   中英

如何更改UIActivityViewController觸發的“發送消息”對話框中的顏色?

[英]How do you change the colors in the Send Message dialog triggered by UIActivityViewController?

我正在使用UIActivityViewController來允許用戶在我的應用程序中發送消息。 問題是當我選擇Message作為我的共享方法時,“To:”部分繼承了我的NavigationBar的背景顏色。

選擇“消息”作為方法時,這只是一個問題 - 如果選擇“郵件”,導航欄下方的所有內容都會顯示為白色背景。

這是我的問題的截圖:

在此輸入圖像描述

在我的AppDelegate.m我在didFinishLaunchingWithOptions有以下代碼:

[UINavigationBar appearance].barTintColor = [RMTheme theme].accentLight;
[UINavigationBar appearance].tintColor    = [UIColor whiteColor];

並使用以下代碼觸發活動控制器:

UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];
[self presentViewController:activityViewController animated:YES completion:nil];

好吧,我相信你在展示你的UIActivityViewController時會使用“PUSH”風格,而你應該使用“Modal”風格。

故事板

故事板

[yournavigationController presentModalViewController:YourActivityViewController animated:YES];

解決方案2 - 使用圖像

[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"top_bar3"] forBarMetrics:UIBarMetricsDefault];

解決方案3 - 設置條紋色調

[[self navigationController]navigationBar].barTintColor = [UIColor whiteColor];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM