How to customize FBLoginVIew?

后端 未结 17 852
暗喜
暗喜 2020-12-02 05:56

In order to connect to facebook in my ios app i\'m using FBLoginVIew from Facebook SDK for iOS.

It shows a nice FB Login Button, but I want to use my own image and t

17条回答
  •  庸人自扰
    2020-12-02 06:57

    If you refer to https://github.com/facebook/facebook-ios-sdk/blob/master/src/UI/FBLoginView.m, line 299 you'll see that the text is provided by an instance method in FBLoginView. Therefore you can change this text by deriving your own class from FBLoginView and providing your own implementation of logInText:

    @interface CustomFBLoginView : FBLoginView
    
    @end
    
    @implementation CustomFBLoginView
    
    -(NSString*) logInText {
        return @"Some custom text";
    }
    
    @end
    

    This is a little risky as it does depend on internal implementation details.

提交回复
热议问题