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)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.