如何将我的 FBSDKLoginButton 正确显示到我的 UITableViewCell。我没有足够的声誉来发布图片所以 here's the link to my screenshot .
正如您从我的屏幕截图中看到的那样,注销按钮被部分隐藏了。这是我的 tableView:cellForRowAtIndexPath
函数的代码片段:
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
}
最佳答案
我能够通过这段代码正确显示 facebook 注销按钮:
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
}
我不知道这是否正确,但它对我有用。我现在的截图looks like this .
关于swift - 如何在 UITableViewCell 中显示 FBSDKLoginButton?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31378719/