像博客帖子Facebook按钮



我有一个博客,每个帖子下面都有一个Facebook like按钮。我想把这个按钮添加到android应用程序中,就像那篇博客文章一样。这可能吗?如果是,那么是怎么做的?

我必须使用Facebook SDK吗?

这是按钮在博客中的显示方式。

<iframe allowTransparency='true' expr:src='&quot;http://www.facebook.com/plugins/like.php?href=&quot; + data:post.canonicalUrl+&quot;&amp;send=false&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=21&quot;' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:90px; height:21px;'/>

试试这个:它为我工作

<com.facebook.widget.LikeView
                    android:id="@+id/like"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:text="Like"
                    />
在android类文件中添加以下代码:
  LikeView likeView = (LikeView) findViewById(R.id.like);
        likeView.setObjectId("Your URL);

最新更新