PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, June 29, 2022

[FIXED] How to display FBSDKLoginButton in a UITableViewCell?

 June 29, 2022     facebook-sdk-4.0, ios8, swift, uitableview, xcode6     No comments   

Issue

how can I properly display my FBSDKLoginButton to my UITableViewCell. I don't have enough reputation to post images so here's the link to my screenshot.

As you can see from my screenshot, the logout button is partially hidden. Here's my code snippet for my tableView:cellForRowAtIndexPath function:

if indexPath.row == 4 { //LOGOUT
        fbLoginButton.readPermissions = ["public_profile"]
        fbLoginButton.delegate = self
        fbLoginButton.center = myCell.contentView.center
        myCell.contentView.addSubview(fbLoginButton)
        myCell.accessoryType = UITableViewCellAccessoryType.None
        myCell.selectionStyle = UITableViewCellSelectionStyle.None
}

Solution

I was able to show the facebook logout button properly by this code:

if indexPath.row == 4 { //LOGOUT
        fbLoginButton.delegate = self
        fbLoginButton.center = CGPointMake(tableView.bounds.width/2, fbLoginButton.bounds.height / 1.4)
        myCell.addSubview(fbLoginButton)
        myCell.accessoryType = UITableViewCellAccessoryType.None
        myCell.selectionStyle = UITableViewCellSelectionStyle.None
}

I don't know if this is the right way but it works for me. My screenshot now looks like this.



Answered By - Esthon Wood
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing