Search code examples
iosxcodefacebookfacebook-sdk-4.x

Edit FBSDKShareButton's design


Good evening SOs!

I would like to adjust the layout and text on my FaceBook-share-button so it says something else than just "Share"

Is this possible? I have been able to adjust the Frame of the button but I would at least like to change "Share" to something else. Or perhaps get Share in Swedish at least!

This is my code:

    FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
    content.contentURL = [NSURL URLWithString:@"http://www.google.se"];
    content.contentTitle=@"I like google!";

    FBSDKShareButton *button = [[FBSDKShareButton alloc] init];
    button.shareContent = content;
    button.frame =  CGRectMake(self.view.center.x, self.view.center.y, 100, 50);
    button.center = self.view.center;

    [self.view addSubview:button];

Solution

  • You can't alter the design of the share button that ships with the Facebook SDK for iOS. What you can do is to build your own button (using a UIButton) and make it call the sharing code once tapped.