How to customize FBLoginVIew?

后端 未结 17 855
暗喜
暗喜 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:55

    In My case I created a good looking Button in Photoshop and simply put it on top of faceBook button. (I know that Apple doesn't advice to put view on button But iterating on the subviews doesn't look nice to me). Hard to understand why such company as FB didn't provide simple way to do it.

    UIImageView *fbImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"facebookButton.png"]];
    CGRect newFrame = fBButtonFrame;
    newFrame.origin.x = 0; newFrame.origin.y = 0;
    [fbImageView setFrame:newFrame];
    [fbImageView setUserInteractionEnabled:NO];
    
    FBLoginView *loginView = [[FBLoginView alloc] init];
    [loginView setFrame:fBButtonFrame];
    [loginView addSubview:fbImageView];
    [self.view addSubview:loginView];
    

提交回复
热议问题