[英]Get value from strings.xml in Facebook SDK
I am setting up my app with Facebook login and am trying to get some of the pre set strings and colors from the Facebook SDK and use them in my activity_login.xml. 我正在使用Facebook登录名设置我的应用,并尝试从Facebook SDK中获取一些预设的字符串和颜色,并在我的activity_login.xml中使用它们。 Something like this
像这样
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="100dp"
android:text="@string/com_facebook_loginview_log_in_button"
android:textColor="@color/com_facebook_loginview_text_color"
android:textSize="@dimen/com_facebook_loginview_text_size"
android:textStyle="bold"
android:background="@drawable/com_facebook_button_blue"
android:drawableLeft="@drawable/com_facebook_inverse_icon"
android:drawablePadding="@dimen/com_facebook_likebutton_compound_drawable_padding"
android:paddingLeft="@dimen/com_facebook_loginview_padding_left"
android:paddingTop="@dimen/com_facebook_loginview_padding_top"
android:paddingRight="@dimen/com_facebook_loginview_padding_right"
android:paddingBottom="@dimen/com_facebook_loginview_padding_bottom"
android:onClick="onLoginClick"/>
But I get an error Cant resolve symbol @string/com_facebook_loginview_log_in_button
and I have imported the Facebook SDK correctly and it is good, but I can't seem to use the values? 但是我收到一个错误,
Cant resolve symbol @string/com_facebook_loginview_log_in_button
并且我已经正确导入了Facebook SDK,它很好,但是我似乎无法使用这些值?
Thanks for the help in advance. 我在这里先向您的帮助表示感谢。 :)
:)
Is there a reason you can't use the Facebook button? 您有不能使用Facebook按钮的原因吗?
<com.facebook.widget.LoginButton
android:id="@+id/facebook_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
Make sure you import Facebook SDK into your project for this to work. 确保将Facebook SDK导入到项目中,以使其正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.