Ios 如何在使用FBSDK共享对话框时更改UIBarButtonItem的色调

Ios 如何在使用FBSDK共享对话框时更改UIBarButtonItem的色调,ios,objective-c,uinavigationbar,uibarbuttonitem,fbsdk,Ios,Objective C,Uinavigationbar,Uibarbuttonitem,Fbsdk,我对uibarbuttonite的颜色有问题 我已经设置了[[uibarbuttonite外观]setTintColor:[UIColor-whiteColor]]用于在应用程序中使用默认颜色 但是在这个屏幕上。它似乎看不见按钮,因为它是白色的! 我使用ViewController中的FBSDKShareDialog show来显示共享弹出屏幕。如何编辑此屏幕的“淡色” 编辑以了解更多信息 作为建议,它仅适用于此屏幕。但实际上我的问题是在我把这个屏幕改成蓝色之后。这将影响发送电子邮件屏幕。所以在

我对uibarbuttonite的颜色有问题

我已经设置了
[[uibarbuttonite外观]setTintColor:[UIColor-whiteColor]]用于在应用程序中使用默认颜色

但是在这个屏幕上。它似乎看不见按钮,因为它是白色的! 我使用ViewController中的FBSDKShareDialog show来显示共享弹出屏幕。如何编辑此屏幕的“淡色”

编辑以了解更多信息

作为建议,它仅适用于此屏幕。但实际上我的问题是在我把这个屏幕改成蓝色之后。这将影响发送电子邮件屏幕。所以在电子邮件屏幕上,它似乎也看不到按钮,因为我的导航栏是蓝色的。那是骗子。我使用UIActivityController显示电子邮件屏幕


目标c

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window.tintColor = [UIColor whiteColor];
return YES; 
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if([UINavigationBar conformsToProtocol:@protocol(UIAppearanceContainer)]) {
    [UINavigationBar appearance].tintColor = [UIColor whiteColor];
}

return YES;
}
//*****************************************************************************

Swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
self.window?.tintColor = UIColor.white
return true
}

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
if UINavigationBar is UIAppearanceContainer {
    UINavigationBar.appearance().tintColor = UIColor.white
}
return true
}

目标c

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window.tintColor = [UIColor whiteColor];
return YES; 
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if([UINavigationBar conformsToProtocol:@protocol(UIAppearanceContainer)]) {
    [UINavigationBar appearance].tintColor = [UIColor whiteColor];
}

return YES;
}
//*****************************************************************************

Swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
self.window?.tintColor = UIColor.white
return true
}

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
if UINavigationBar is UIAppearanceContainer {
    UINavigationBar.appearance().tintColor = UIColor.white
}
return true
}

如果您还没有弄清楚这一点,那么可以使用代理进行
FBSDKSharing

- (IBAction)shareOnFacebook:(id)sender
{
    FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
    content.contentTitle = @"Content Title";
    content.contentURL = [NSURL URLWithString:@"https://example.com/url/to/your/app"];
    content.quote = @"Learn quick and simple ways for people to share content from your app or website to Facebook.";

    // make the changes here; what you want to see in FB Dialog
    [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];

    FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];
    dialog.fromViewController = self;
    dialog.shareContent = content;
    dialog.mode = FBSDKShareDialogModeShareSheet;
    dialog.delegate = self;
    [dialog show];
}

// And change it back in these delegate methods
-(void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results
{
}

-(void)sharerDidCancel:(id<FBSDKSharing>)sharer
{
}

-(void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error
{
}
-(iAction)shareOnFacebook:(id)发件人
{
FBSDKShareLinkContent*内容=[[FBSDKShareLinkContent alloc]init];
content.contentTitle=@“内容标题”;
content.contentURL=[NSURL URLWithString:@”https://example.com/url/to/your/app"];
content.quote=@“学习让人们快速、简单地将应用程序或网站中的内容共享到Facebook的方法。”;
//在此处进行更改;您希望在FB对话框中看到的内容
[[UINavigationBar外观]setBackgroundImage:[UIImage alloc]init]forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
FBSDKShareDialog*对话框=[[FBSDKShareDialog alloc]init];
dialog.fromViewController=self;
dialog.shareContent=内容;
dialog.mode=FBSDKShareDialogModeShareSheet;
dialog.delegate=self;
[对话显示];
}
//并在这些委托方法中将其更改回
-(void)sharer:(id)sharer未完成结果:(NSDictionary*)结果
{
}
-(作废)SharerDicCancel:(id)sharer
{
}
-(无效)共享者:(id)共享者错误:(N错误*)错误
{
}

如果您还没有弄清楚这一点,您可以使用代理进行
FBSDKSharing

- (IBAction)shareOnFacebook:(id)sender
{
    FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
    content.contentTitle = @"Content Title";
    content.contentURL = [NSURL URLWithString:@"https://example.com/url/to/your/app"];
    content.quote = @"Learn quick and simple ways for people to share content from your app or website to Facebook.";

    // make the changes here; what you want to see in FB Dialog
    [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];

    FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];
    dialog.fromViewController = self;
    dialog.shareContent = content;
    dialog.mode = FBSDKShareDialogModeShareSheet;
    dialog.delegate = self;
    [dialog show];
}

// And change it back in these delegate methods
-(void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results
{
}

-(void)sharerDidCancel:(id<FBSDKSharing>)sharer
{
}

-(void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error
{
}
-(iAction)shareOnFacebook:(id)发件人
{
FBSDKShareLinkContent*内容=[[FBSDKShareLinkContent alloc]init];
content.contentTitle=@“内容标题”;
content.contentURL=[NSURL URLWithString:@”https://example.com/url/to/your/app"];
content.quote=@“学习让人们快速、简单地将应用程序或网站中的内容共享到Facebook的方法。”;
//在此处进行更改;您希望在FB对话框中看到的内容
[[UINavigationBar外观]setBackgroundImage:[UIImage alloc]init]forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
FBSDKShareDialog*对话框=[[FBSDKShareDialog alloc]init];
dialog.fromViewController=self;
dialog.shareContent=内容;
dialog.mode=FBSDKShareDialogModeShareSheet;
dialog.delegate=self;
[对话显示];
}
//并在这些委托方法中将其更改回
-(void)sharer:(id)sharer未完成结果:(NSDictionary*)结果
{
}
-(作废)SharerDicCancel:(id)sharer
{
}
-(无效)共享者:(id)共享者错误:(N错误*)错误
{
}

如果([UINavigationBar conformsToProtocol:@protocol(UIAppearanceContainer)]{[UINavigationBar外观].tintColor=[UIColor whiteColor];}@Jigar我必须设置
[[UIBarButtonItem外观]setTintColor:[UIColor whiteColor]]因为当用户单击发送到电子邮件时。按钮默认设置为蓝色,我的导航栏颜色也为蓝色。因此,如果([UINavigationBar conformsToProtocol:@protocol(UIAppearanceContainer)]{[UINavigationBar外观],[UIColor whiteColor];}@Jigar我必须设置
[[UIBarButtonItem外观]setTintColor:[UIColor whiteColor]因为当用户单击发送到电子邮件时。按钮默认设置为蓝色,我的导航栏颜色也为蓝色。所以威尔看不出这个扣子式餐具,你的建议可以改变颜色,但我解释了更多的信息。因此,这将不会工作令人担忧的Dishant,您的建议可以改变颜色,但我解释了更多信息的问题。所以这是行不通的