Is it possible to change Facebook login button image in Facebook Android SDK3?

后端 未结 4 2451
一个人的身影
一个人的身影 2020-12-13 00:11

Facebook Android sdk has a com.facebook.widget.LoginButton

I want to put my own image for the Login button. Is it possible ?

So far i\'ve tried

4条回答
  •  执笔经年
    2020-12-13 01:09

    An other way

    loginButton = (LoginButton) findViewById(R.id.fb_login_button);
    loginButton.setVisibility(View.GONE);
    
    
    
    
    ImageView ivFbCustomButton = (ImageView) findViewById(R.id.iv_fb_custom_button);
    ivFbCustomButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            com.facebook.login.widget.LoginButton btn = new com.facebook.login.widget.LoginButton(FacebookActivity.this);
            btn.performClick();
        }
    });
    

    Note:

    You have to write the code for two buttons in XML file. One is for default facebook button (We are hiding it at initial step). Second one is for custom button

提交回复
热议问题