【发布时间】:2015-10-07 22:39:44
【问题描述】:
我正在使用此代码在 Xamarin IOS 中进行共享:
public void Share(string title, string content)
{
if (UIApplication.SharedApplication.KeyWindow == null || UIApplication.SharedApplication.KeyWindow.RootViewController == null)
return;
if (string.IsNullOrEmpty(title) || string.IsNullOrEmpty(content))
return;
var rootController = UIApplication.SharedApplication.KeyWindow.RootViewController;
var imageToShare = UIImage.FromBundle("icon_120.png");
var itemsToShare = new NSObject[] { new NSString(content), imageToShare };
var shareStatusController = new UIActivityViewController(itemsToShare, null)
{
Title = title
};
//shareStatusController.NavigationController.NavigationBar.TintColor = UIColor.Black;
//rootController.NavigationController.NavigationBar.TintColor = UIColor.Black;
//shareStatusController.NavigationBar.TintColor = UIColor.FromRGB(0, 122, 255);
rootController.PresentViewController(shareStatusController, true, null);
Mvx.Resolve<IAnalyticsService>().LogEvent("Share button clicked.");
}
当我选择邮件时,我被重定向到这里http://take.ms/3KE4F。但是取消和发送按钮的颜色是白色的(在 NavigationBar 中)。如何更改此按钮的文本颜色?
我找到了文章 Cannot set text color of Send and Cancel buttons in the mail composer when presented from the UIActivityViewController in iOS7。但不知道如何使用 Xamarin 应用它。
感谢您的帮助。
【问题讨论】:
标签: ios mobile xamarin xamarin.ios