Adding Custom Facebook Like buttons in android

♀尐吖头ヾ 提交于 2019-12-02 08:02:05

According to our brand permissions policies which you can read here, under the Facebook Like Button section:

While you may scale the size to suit your needs, you may not modify the Like Button in any other way (such as by changing the design).

So the answer is no, you cannot use custom Like buttons.

You can't. Facebook like buttons can only be the official buttons.

Because it's Android you can customize absolutely everything. For example I have created sample custom LikeView. You can set any color you want but try to consider Facebook convention.

How to do?

Rule as following:
In Android application if you reimplement resource from any SDK it overides it to new value which you set.
I have found these variables from FacebookSdk classes and has overided it on my own application. You can do too.
1. Add following style to your style file and set your own selector. It will overide LikeButton selector

<style name="com_facebook_button_like" parent="com_facebook_button">
    <item name="android:background">@drawable/btn_facebook_like_background_selector</item>
</style> 

2.Add following colors to your color.xml file. Set any color you want.

<color name="com_facebook_likeboxcountview_text_color">#FFFFFFFF</color>
<color name="com_facebook_likeboxcountview_border_color">#FFFFFFFF</color>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!