简体   繁体   English

tableViewCell中的fbLoginView

[英]fbLoginView in tableViewCell

I have a sideMenuControllerView. 我有一个sideMenuControllerView。 I am trying to create last cell of the sideMenuControllerTableView a facebook logout cell. 我试图创建sideMenuControllerTableView的最后一个单元格一个Facebook注销单元格。 I do the following in cellforRowAtIndexPath.. 我在cellforRowAtIndexPath中执行以下操作。

        FBLoginView *loginView = [[FBLoginView alloc] init];
        [cell.sideImage addSubview:loginView];
        loginView.delegate = self;

where cell is a custom SideMenuCell having a sideImage as a property. 其中cell是具有sideImage作为属性的自定义SideMenuCell。

I also put the FBLoginViewDelegate in SideMenuController.h. 我还将FBLoginViewDelegate放在SideMenuController.h中。 And I implemented the required functions. 我实现了所需的功能。 The only thing I am missing is in didSelectRowAtIndexPath I don't know how to call 我唯一缺少的是在didSelectRowAtIndexPath中,我不知道如何调用

loginViewShowingLoggedOutUser:(FBLoginView *)loginView

Any quick pointers ? 任何快速指示? Thanks! 谢谢!

Any particular reason you need to call this method? 您需要调用此方法的任何特殊原因吗? You only need to implement this function in your controller and take any actions that are needed when user logs out. 您只需要在控制器中实现此功能,并在用户注销时采取所需的任何操作即可。 Being a delegate method,it'll be called by facebook library functions when user logs out. 作为一种委托方法,当用户注销时,它将由facebook库函数调用。 The FBLoginView will display a button that'll show either "Login" if user is not logged in OR it'll show "Logout" if the user is already logged in. FBLoginView将显示一个按钮,如果用户未登录,它将显示“登录”,或者如果用户已经登录,则将显示“注销”。

If you're able to setup FBLoginView into cell, then you'll only need to implement its delegate which let you know when user LoggedOut or LoggedIn , in that way you can manage to show proper UI in your side menu. 如果您能够将FBLoginView设置到单元格中,则只需实现其委托,该委托可以在用户LoggedOutLoggedIn时通知您,从而可以在侧菜单中显示适当的UI。 I don't aware of this so can't show you the code. 我不知道这一点,因此无法向您显示代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM