[英]Can I unify the style of facebook sign in button like Google in android app?
I'm making the app with the sign-in system. 我正在使用登录系统制作该应用程序。 But I want to unify the style of each button.
但是我想统一每个按钮的样式。 My activity_login.xml show what I'm using the widget.
我的activity_login.xml显示了我正在使用的小部件。 I want to apply the Google button style to 'continue with Facebook'.
我想将Google按钮样式应用于“继续使用Facebook”。
<com.google.android.gms.common.SignInButton
android:id="@+id/login_sign_google"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.facebook.login.widget.LoginButton
android:layout_width="match_parent"
android:layout_height="wrap_content" />
Simplest solution is just add these buttons in to layout, make their visibility
- GONE
and add custom buttons with whatever you want styling. 最简单的解决方案是将这些按钮添加到布局中,使其
visibility
- GONE
并添加具有所需样式的自定义按钮。
And on click just pass click event like this: 在单击时,只需传递如下所示的click事件:
loginFacebookStyledButton.setOnClickListener {
loginFacebookActualInvisibleButton.performClick()
}
With google sign in I dont think that you need to have SignInButton
simple styled button does the job. 使用Google登录后,我认为您不需要
SignInButton
简单样式的按钮即可完成工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.