SHARESDK integration Here is not detailed introduction, the official website has been enough detail.
The official default sharing style is as follows:
Paste my source code:
Create share picture NSString *imageurlstring = @ "http://mob.com/Assets/images/logo.png?v=20150320"; nsarray* Imagearray = @[imageurlstring]; Share content parameters Nsmutabledictionary *shareparams = [Nsmutabledictionary dictionary]; [Shareparams SSDKSetupShareParamsByText:self.productModel.data.title Images:imagearray Url:[nsurl urlwithstring:@ "http://www.konvy.com"] title:@ "xxxx" type:ssdkcontenttypeauto]; [Shareparams Ssdkenableuseclientshare]; __weak typeof (self) weakself = self; Share [sharesdk showshareeditor:type Otherplatformtypes:nil Shareparams:shareparams onsharestatechanged:^ (ssdkresponsestate state, Ssdkplatformtype Platformtype, Nsdictionary *userData, Ssdkcontententity *contententity, Nserror *error, BOOL end) {switch (state) {case SSDKRESPONSESTATESUC Cess: NSLog (@ "Success"); Break Case Ssdkresponsestatefail:nslog (@ "fail"); Break Default:break; } }];
Here is the code to modify the style (seemingly in the official website I did not find this thing, I hope the following code for everyone a bit of effect):
Note that the integration of the Sharesdkui module (Cocoapods can be integrated via pod ' Sharesdk3/sharesdkui ') is required here.
Then, in the place where you need to modify the share view style, paste the code.
#import <ShareSDK/ShareSDK.h> #import <ShareSDKUI/ShareSDK+SSUI.h> #import <sharesdkui/ Ssuieditorviewstyle.h>.//Create share picture NSString *imageurlstring = @ "http://mob.com/Assets/images/logo.png?v= 20150320 "; nsarray* Imagearray = @[imageurlstring]; Share content parameters Nsmutabledictionary *shareparams = [Nsmutabledictionary dictionary]; [Shareparams SSDKSetupShareParamsByText:self.productModel.data.title Images:imagearray Url:[nsurl urlwithstring:@ "http://www.xxxx.com"] title:@ "xxxx" type:ssdkcontenttypeauto]; [Shareparams Ssdkenableuseclientshare]; Initialize the editing interface [Ssuieditorviewstyle Setiphonenavigationbarbackgroundcolor:rpnavbarcolor]; [Ssuieditorviewstyle Settitlecolor:[uicolor Whitecolor]; [Ssuieditorviewstyle Setcancelbuttonlabelcolor:[uicolor Whitecolor]; [Ssuieditorviewstyle SETSHAREBUTTONLABELCOlor:[uicolor Whitecolor]]; [Ssuieditorviewstyle settitle:@ "Share"]; [Ssuieditorviewstyle Setcancelbuttonlabel:rplocaolizedstringforkey (@ "Cancel_title")]; [Ssuieditorviewstyle Setsharebuttonlabel:rplocaolizedstringforkey (@ "Sure_title")]; Share [sharesdk showshareeditor:type Otherplatformtypes:nil Shareparams:shareparams onsharestatechanged:^ (ssdkresponsestate state, Ssdkplatformtype Platformtype, Nsdictionary *userData, Ssdkcontententity *contententity, Nserror *error, BOOL end) {switch (state) {case SSDKRESPONSESTATESUC Cess:nslog (@ "xxxx"); Break Case Ssdkresponsestatefail:nslog (@ "xxxx"); Break Default:break; } }];
In addition, here is a more puzzling question:
If you use code like the following to modify the global style of the control: May cause the above part of the code to fail, I asked their technical staff, they blindly said do not know ... orz.
[[Uitextfield appearance] Settintcolor:[uicolor Redcolor]]; [[Uitextview appearance] Settintcolor:[uicolor Redcolor]];
The following are the issues that occur after the modification:
You will find that the color of the left and right two item is still unchanged.
After commenting on the two lines of code mentioned above, everything is fine ...
In addition Ssuieditorviewstyle This class there are other interfaces can modify the style of this interface, such as modify the button background image ah, the text content of the Beijing color ah and so on ...
Interested, can go to see ...
#import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface ssuieditorviewstyle:nsobject/*** Set the navigation bar background * * @param image background Image */+ (void) Setiphonenavigationbarbackgroundimage: (UIImage *) image;/** * Set the iphone navigation bar Color * * @pa Ram Color background color */+ (void) Setiphonenavigationbarbackgroundcolor: (Uicolor *) color;/** * Set ipad navigation bar Color * * @param color background color */+ (void) Setipadnavigationbarbackgroundcolor: (Uicolor *) color;/** * Set editing interface background color * * @param color background color */+ (void) Setconte Ntviewbackgroundcolor: (Uicolor *) color;/** * Set Title * * @param title title */+ (void) Settitle: (NSString *) title;/** * Set Caption text Color * * @param color */+ (void) Settitlecolor: (Uicolor *) color;/** * Set Cancel button Label * * @param label Cancel button label */+ (void) Setcan Celbuttonlabel: (NSString *) label;/** * Set Cancel button Label text color * * @param color color */+ (void) Setcancelbuttonlabelcolor: (Uicolor *) c olor;/** * Set Cancel button Background * * @param image picture */+ (void) Setcancelbuttonimage: (UIImage *) image;/** * Set Share button tag * * @param labe L Cancel button label */+ (void) SetsharebuttOnlabel: (NSString *) label;/** * Set share button label text color * * @param color color */+ (void) Setsharebuttonlabelcolor: (Uicolor *) color;/** * Set Share button background * * @param image Image */+ (void) Setsharebuttonimage: (UIImage *) image;/** * Set supported page orientation (share edit page separately) */+ (void) sets Upportedinterfaceorientation: (uiinterfaceorientationmask) tointerfaceorientation;/** * Settings share edit page status bar style */+ (void) Setstatusbarstyle: (Uistatusbarstyle) Statusbarstyle; @end
iOS change SHARESDK default sharing feature interface