简体   繁体   English

像Facebook whit Facebook SDK 3.19.1一样添加按钮

[英]Add Button Like Facebook whit Facebook SDK 3.19.1

I am creating an application to add the facebook like button, i'm using Facebook SDK version 3.19.1, and Android Studio 0.86, the problem is that in the layout not implement com.facebook.widget.LikeView. 我正在创建一个添加按钮之类的facebook的应用程序,我使用的是Facebook SDK版本3.19.1和Android Studio 0.86,问题是在布局中未实现com.facebook.widget.LikeView。 The error is The following classes could not be found: - com.facebook.widget.LikeView 错误是找不到以下类:-com.facebook.widget.LikeView

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MyActivity">


<com.facebook.widget.LikeView
    android:id="@+id/like"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Like"></com.facebook.widget.LikeView>

` `

The library is add in my project, for add library, i used this guide Android Studio 0.8.1 - how to use Facebook SDK? 该库是在我的项目中添加的,对于添加库,我使用了本指南Android Studio 0.8.1-如何使用Facebook SDK?

I think you have not properly added the facebook library :- 我认为您没有正确添加Facebook库:-

Right click your project ->Java build path -> Order and Export and make sure the facebook library is checked. 右键单击您的项目-> Java构建路径->订购并导出,并确保已选中facebook库。

Also, make sure under Android dependencies > facebooksdk.jar, that you see com.facebook.widget.LoginButton. 此外,请确保在Android依赖项> facebooksdk.jar下,您看到com.facebook.widget.LoginButton。

If it's still not working, try deleting the facebook library, re-adding it, close and restart Eclipse. 如果仍然无法正常运行,请尝试删除Facebook库,重新添加它,然后关闭并重新启动Eclipse。

尝试将xmlns:facebook="http://schemas.android.com/apk/res-auto"到RelativeLayout

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM