我正在尝试在 Android 中使用 Facebook SDK分享内容 https://developers.facebook.com/docs/sharing/android来自我的应用程序的方向。
我从这里开始使用以下代码脸书文档 https://developers.facebook.com/docs/sharing/android:
ShareLinkContent content = new ShareLinkContent.Builder()
.setContentUrl(Uri.parse("http://www.focusoutdistractions.com/"))
.build();
ShareButton shareButton = (ShareButton) rootView.findViewById(R.id.ibtn_twshare);
shareButton.setShareContent(content);
问题是- 在XML文件中,我需要添加com.facebook.share.widget.Sharebutton到 XML,但它没有被识别。
Is com.facebook.share.widget.Sharebutton为此共享按钮添加正确的 XML 元素?
Yes, com.facebook.share.widget.ShareButton
是正确的 XML 元素。它不会通过 XML 布局预览来呈现,但不用担心。该应用程序将毫无问题地编译,并且运行应用程序将正确显示它。
<com.facebook.share.widget.ShareButton
android:id="@+id/shareButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)