有没有办法定制Sharekit?
默认情况下,Sharekit 使用 actionSheet 来共享项目。 有没有办法在一个小的 UIView 中而不是在 actionSheet 中仅显示特定的项目,例如仅 facebook、twitter 和电子邮件?
编辑: 换句话说:
我的 UIView
中有 3 个按钮,一个用于 facebook、twitter 和电子邮件。我不想使用 Sharekit 的 actionSheet。有没有办法通过按我的 UIButton 来在 Sharekit 中一一调用 FBConnect、Twitter 和电子邮件共享?
By default, Sharekit uses an actionSheet to sharing items.
Is there any way to show only specific items, such as only facebook, twitter, and email, in a small UIView
, not in an actionSheet?
Edit:
Put another way:
I have 3 buttons in my UIView
, one for facebook, twitter and email. I don't want to use Sharekit's actionSheet. Is there any way to call FBConnect, Twitter and Email sharing, one by one, in Sharekit by pressing my UIButton
's?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在这里找到它:
http://getsharekit.com/docs/#specific-service
i found it here:
http://getsharekit.com/docs/#specific-service
是的。这将需要一些工作,但可以按如下方式完成:
在
SHK.m
中找到此方法更改
,并将switch 语句的每个实例
或您想要支持的其他选项 为以下内容(即,如果您只想 twitter 和 facebook 添加
@"SHKTwitter"
, 到数组中),这将消除其他选项,但显示选项的操作表不会反映更改,它仍然会提供更多选项,我们还需要禁用它。
因此,要执行此操作,请转到
SHKActionSheet.m
在这种方法中,您可以选择将标题从“共享”更改为更具体的内容,即。 “与 Facebook 和 Twitter 分享”。为此,请转至以下方法并进行指示的更改。
更改
然后在相同的方法中
,删除这一行:我们必须删除这一行的原因是因为之前我们删除了“更多”按钮,现在我们必须确保代码不会将任何其他按钮与“更多”按钮混淆。必须删除“更多”按钮,因为它显示了使用我们不希望用户使用的其他共享方法的选项。如果我们不删除它,用户仍然可以访问禁用的共享方法。
希望这有帮助。
Yes. It will take a little work but it can be done as follows:
in
SHK.m
find this methodand change
to the following for each instance of the switch statement
or what ever other options you want to support (ie if you only want twitter and facebook add
@"SHKTwitter"
, to the array)that will eliminate the other options but the action sheet that displays the options wont reflect the change and it will still give the more option, which we also need to disable.
So to do that go to
SHKActionSheet.m
While in this method you can optionally change the title from "Share" to something more specific, ie. "Share with Facebook and Twitter". To do that, go to the following method and make the change indicated.
change
then in that same method, remove this line:
The reason why we have to remove this is because earlier we removed the more button, and now we have to make sure the code doesn’t confuse any other button with the more button. The more button had to be removed because it revealed options to use other sharing methods we don’t want the user to use. If we didn't remove it, the user would still be able to access a disabled share method.
Hope this helps.
使用最新版本的 ShareKit 2.0 执行此操作的新方法是覆盖 SHKConfigurator 中的以下方法(扩展 DefaultSHKConfigurator.m)
The new way to do this with latest version of ShareKit 2.0 is to overwrite the following methods in your SHKConfigurator (extending DefaultSHKConfigurator.m)