Adding Custom Facebook Like buttons in android

前端 未结 3 388
耶瑟儿~
耶瑟儿~ 2021-01-28 05:30

I want to use custom like button instead of Facebook\'s Like button in my android application.Is it possible to use custom Like buttons? How to implement this?I searched in Stac

相关标签:
3条回答
  • 2021-01-28 05:56

    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.

    0 讨论(0)
  • 2021-01-28 06:03

    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>
    
    0 讨论(0)
  • 2021-01-28 06:05

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

    0 讨论(0)
提交回复
热议问题