我继承了一些代码并正在处理它,但是,当我尝试构建它时,我遇到了以下问题:
activity_login.xml:26: error: No resource identifier found for attribute 'login_text' in package
我的按钮xml如下:
<com.facebook.widget.LoginButton
xmlns:fb="http://schemas.android.com/apk/res-auto"
android:id="@+id/facebookBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:textColor="@color/white"
android:textAppearance="@android:style/TextAppearance.Small"
android:gravity="center"
android:onClick="facebookBtnClick"
android:paddingLeft="30dp"
fb:login_text="@string/loginWithFacebook"
/>
我也试过放入 xmlns:fb="http://schemas.android.com/apk/res/com.facebook.widget"
但这对我也不起作用,如果有人有任何建议,我将不胜感激
最佳答案
您可以在这里找到信息 https://developers.facebook.com/docs/android/upgrading-4.x
Style attr tags are now namespaced to avoid conflicts. Apps will need to add the namespace "com_facebook_" to their existing facebook sdk style attrs.
所以,现在使用 fb:com_facebook_login_text
。
关于android - Facebook 登录按钮小部件没有资源标识符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27062334/