我目前正在嘗試設計右上角的“取消”按鈕(導航欄和按鈕都是灰色的),但我沒有運氣。我試過呼叫幾種不同的方法,但都沒有奏效。我的專案為 iOS12.1 構建,我正在通過 iOS15.4 進行測驗。這是我迄今為止嘗試過的:
[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[UIFont fontWithName:@"Futura-Medium" size:17.0f],
NSFontAttributeName,
[UIColor blueColor],
NSForegroundColorAttributeName,
nil]];
MFMessageComposeViewController *messageController;
[messageController.navigationBar setTintColor:[UIColor blueColor]];
messageController = [MFMessageComposeViewController new];
[UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:[NSArray arrayWithObject:[UINavigationBar class]]].tintColor = [UIColor RepublicBrightBlue];
uj5u.com熱心網友回復:
按鈕的灰色可能來自您的應用程式的全域色調。默認情況下,這是資產中的 AccentColor(通過構建設定映射)。請注意,您可以為Any, Light, Dark

如果您只是對這個 MFMessageComposeViewController 的樣式感興趣,那么以下內容對我來說可以更改訊息視圖中所有視圖的色調顏色:
MFMessageComposeViewController *messageController = [MFMessageComposeViewController new];
[self presentViewController:messageController animated:true completion:nil];
[UIView appearanceWhenContainedInInstancesOfClasses:[NSArray arrayWithObject:[MFMessageComposeViewController class]]].tintColor = [UIColor redColor];
這導致
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/496669.html
標籤:目标-c ios-暗模式 mfmessagecomposeview
上一篇:電腦必須打開的設定
