0
我有一個Xamarin Forms App。我創建了一個FBShareButton:Button來處理通過自定義渲染器進行的共享。這是我的渲染代碼:Xamarin Android:Facebook的內容爲空
public class FacebookShareRenderer : ButtonRenderer
{
ShareButton sb;
protected override void OnElementChanged (ElementChangedEventArgs<Xamarin.Forms.Button> e)
{
base.OnElementChanged (e);
sb = new ShareButton(Context);
this.Control.Click += (sender, eargs) => sb.PerformClick();
sb.Click += (sender, eargs) => {
ShareLinkContent.Builder shareLinkContentBuilder = new ShareLinkContent.Builder().
SetContentDescription("Hello").
SetContentTitle("Desc");
shareLinkContentBuilder.SetImageUrl("url");
ShareLinkContent shareLinkContent = shareLinkContentBuilder.Build();
sb.ShareContent = shareLinkContent;
}
};
}
}
份額對話框打開,並要求我的權利的東西,我應該。但是,內容不會顯示,當我分享他們不顯示。有任何想法嗎?