帮助与文档

> >
케이지드 다운로드

一.自定义分享菜单样式

#import <ShareSDKUI/ShareSDKUI.h>
#import <ShareSDKUI/ShareSDK+SSUI.h>
#import <ShareSDKUI/SSUIShareSheetConfiguration.h>

//1.构造分享参数
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
[dic SSDKSetupShareParamsByText:@"娜娜~ 娜娜啊~~~" 
images:@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1523515635458&di=58aff559df8c0dc61347423610a9aa02&imgtype=0&src=http%3A%2F%2Fwww.yx-w.com%2Ftutu%2F20171103%2Fa21181.jpg" 
url:nil 
title:@"娜娜" 
type:SSDKContentTypeAuto];

SSUIShareSheetConfiguration *config = [[SSUIShareSheetConfiguration alloc] init];

//设置分享菜单为简洁样式
 config.style = SSUIActionSheetStyleSimple;

//设置竖屏有多少个item平台图标显示
config.columnPortraitCount = 2;

//设置横屏有多少个item平台图标显示
config.columnLandscapeCount = 3;

//设置取消按钮标签文本颜色
config.cancelButtonTitleColor = [UIColor redColor];

//设置对齐方式(简约版菜单无居中对齐)
config.itemAlignment = SSUIItemAlignmentCenter;

//设置标题文本颜色
config.itemTitleColor = [UIColor greenColor];

//设置分享菜单栏状态栏风格
config.statusBarStyle = UIStatusBarStyleLightContent;

//设置支持的页面方向(单独控制分享菜单栏)
config.interfaceOrientationMask = UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskLandscape;

//设置分享菜单栏的背景颜色
config.menuBackgroundColor = [UIColor redColor];

//取消按钮是否隐藏,默认不隐藏
config.cancelButtonHidden = YES;

//设置直接分享的平台(不弹编辑界面)
config.directSharePlatforms = @[@(SSDKPlatformTypeSinaWeibo),@(SSDKPlatformTypeTwitter)];

//2.弹出分享菜单
[ShareSDK showShareActionSheet:nil 
customItems:nil 
shareParams:dic 
sheetConfiguration:config 
onStateChanged:^(SSDKResponseState state, SSDKPlatformType platformType, 
NSDictionary *userData, SSDKContentEntity *contentEntity, 
NSError *error, BOOL end) {}

二.自定义分享菜单项

//如果想在我们的分享菜单里添加自己的按钮实现某些功能,需要如下调用

#import <ShareSDKUI/ShareSDKUI.h>
SSUIPlatformItem *item_1 = [[SSUIPlatformItem alloc] init];
item_1.iconNormal = [UIImage imageNamed:@"1"];//默认版显示的图标
item_1.iconSimple = [UIImage imageNamed:@"2.jpg"];//简洁版显示的图标
item_1.platformName = @"girls";
item_1.platformId = @"我爱这个娜娜";
    
SSUIPlatformItem *item_2 = [[SSUIPlatformItem alloc] init];
item_2.iconNormal = [UIImage imageNamed:@"2"];
item_2.iconSimple = [UIImage imageNamed:@"1.jpg"];
item_2.platformName = @"girls_2";
item_2.platformId = @"我爱这个美女";

//添加点击事件
[item_1 addTarget:self action:@selector(costomPlatFormClick:)];
[item_2 addTarget:self action:@selector(costomPlatFormClick:)];

- (void)costomPlatFormClick:(SSUIPlatformItem *)item
{
    NSLog(@"%s,---->%@",__func__,item.platformId);
   // do ..... 호밀밭의 파수꾼 다운로드.
}

[ShareSDK showShareActionSheet:nil 
customItems:@[item_1,item_2] 
shareParams:dic 
sheetConfiguration:nil 
onStateChanged:^(SSDKResponseState state, SSDKPlatformType platformType, 
NSDictionary *userData, SSDKContentEntity *contentEntity, 
NSError *error, BOOL end) {}

三.设置编辑界面样式

#import <ShareSDKUI/ShareSDKUI.h>

id sheet = [ShareSDK showShareActionSheet:nil 
customItems:@[item_1,item_2] 
shareParams:dic 
sheetConfiguration:config 
onStateChanged:^(SSDKResponseState state, SSDKPlatformType platformType, 
NSDictionary *userData, SSDKContentEntity *contentEntity, 
NSError *error, BOOL end) {}

SSUIEditorConfiguration *editorConfig = [[SSUIEditorConfiguration alloc] init];

//设置iPhone导航栏颜色
editorConfig.iPhoneNavigationBarBackgroundColor = [UIColor cyanColor];

//设置iPad导航栏颜色
editorConfig.iPadNavigationBarBackgroundColor = [UIColor cyanColor];

//设置标题
editorConfig.title = @"我爱娜娜";

//标题颜色
editorConfig.titleColor = [UIColor redColor];

//取消按钮标签
editorConfig.cancelButtonTitle = @"取消? 不存在的";

//取消按钮标题文本颜色
editorConfig.cancelButtonTitleColor = [UIColor greenColor];

//分享按钮标签
editorConfig.shareButtonTitle = @"lalalala";

//分享按钮标题文本颜色
editorConfig.shareButtonTitleColor = [UIColor purpleColor];

//设置分享菜单栏状态栏风格
editorConfig.statusBarStyle = UIStatusBarStyleLightContent;

//设置文本视图背景色
editorConfig.textViewBackgroundColor = [UIColor orangeColor];

//设置编辑界面背景颜色
editorConfig.editorViewBackgroundColor = [UIColor redColor];

//设置支持的页面方向(单独控制分享菜单栏)
editorConfig.interfaceOrientationMask = UIInterfaceOrientationMaskLandscapeRight;


[ShareSDK shareActionSheet:sheet setEditorConfiguration:editorConfig];

 

 

다운로드