iOS中UIScrollView、UIWebView、UICollectionView實(shí)現(xiàn)圖文混排

問(wèn)題匯總

1、如何實(shí)現(xiàn)JavaScript與Objective-C間傳值?

點(diǎn)擊Webview中的圖片,放大,需要JavaScript和Objective-C傳值,獲取到具體需要放大哪張圖片。

本方案中,不需要引入WebViewJavascriptBridge,而是通過(guò)【控制Webview重定向方法,攔截發(fā)出的請(qǐng)求】來(lái)實(shí)現(xiàn)。

示例:

//?每個(gè)添加點(diǎn)擊事件(window.location.href),其中selectIndex為圖片標(biāo)識(shí)//?webview發(fā)起請(qǐng)求攔截

-?(BOOL)webView:(UIWebView?*)webView?shouldStartLoadWithRequest:(NSURLRequest?*)request?navigationType:(UIWebViewNavigationType)navigationType{


????//?獲取img標(biāo)識(shí)index

????NSString?*url?=?request.URL.absoluteString;

????NSRange?range?=?[url?rangeOfString:@"selectIndex="];

????if?(range.location?!=?NSNotFound)?{

????????NSInteger?begin?=?range.location?+?range.length;

????????NSString?*index?=?[url?substringFromIndex:begin];

????????NSLog(@"img:?%@",?index);

????????return?NO;

????}

????return?YES;


}

2、如何實(shí)現(xiàn)UIWebView高度自適應(yīng)?

UIWebView自適應(yīng)高度的方案有很多,選擇一個(gè)較為科學(xué)的方式,顯得尤為重要。

本方案中,通過(guò)【KVO監(jiān)聽(tīng)Webview的contentSize】來(lái)實(shí)現(xiàn),需要注意KVO的添加、移除,稍有不慎有Crash風(fēng)險(xiǎn)。

示例:

//?添加監(jiān)聽(tīng)

[self.webView.scrollView?addObserver:self?forKeyPath:@"contentSize"?options:NSKeyValueObservingOptionNew?context:nil];

-?(UIWebView?*)webView

{

????if?(!_webView)?{

????????_webView?=?[[UIWebView?alloc]?initWithFrame:CGRectMake(0,?0,?self.frame.size.width,?self.frame.size.height)];

????????_webView.delegate?=?self;

????????_webView.scrollView.bounces?=?NO;

????????_webView.scrollView.showsHorizontalScrollIndicator?=?NO;

????????_webView.scrollView.scrollEnabled?=?NO;

????????_webView.scalesPageToFit?=?YES;

????}

????return?_webView;

}

//?修改webview的frame

-?(void)observeValueForKeyPath:(NSString?*)keyPath?ofObject:(id)object?change:(NSDictionary?*)change?context:(void?*)context

{

????if?([keyPath?isEqualToString:@"contentSize"])?{

????????CGSize?resize?=?[self.webView?sizeThatFits:CGSizeZero];

????????self.webView.frame?=??CGRectMake(0,?0,?CGRectGetWidth(self.frame),?resize.height);

????}

}

//?移除監(jiān)聽(tīng)

-(void)dealloc

{

????[self.webView.scrollView?removeObserver:self?forKeyPath:@"contentSize"];

}

3、如何實(shí)現(xiàn)UIWebView顯示webp格式圖片?

UIWebView、WKWebview本身都不支持webp格式圖片,需要額外擴(kuò)展。

示例:

//?導(dǎo)入頭文件

#import?//?注冊(cè)?MagicURLProtocol

[[MagicWebViewWebPManager?shareManager]?registerMagicURLProtocolWebView:self.webView];

//?銷(xiāo)毀?MagicURLProtocol

-(void)dealloc

{

????[[MagicWebViewWebPManager?shareManager]?unregisterMagicURLProtocolWebView:self.webView];

}

4、如何實(shí)現(xiàn)圖文混排 + UIKit組件?

使用UIWebView加載自定義HTML代碼的方式,實(shí)現(xiàn)圖文混排。

點(diǎn)擊圖片,放大,function()跳轉(zhuǎn)鏈接,攜帶selectIndex標(biāo)識(shí),通過(guò)攔截UIWebView的請(qǐng)求來(lái)獲取selectIndex標(biāo)識(shí)。

通過(guò)KVO獲取到WebView高度,重新設(shè)置webView.frame,collectionView.frame,scrollView.contentSize

本方案中,圖文混排+UIKit組件,具體邏輯如下:

5、如何自定義HTML代碼?

本方案中,以純圖片為例,處理后的HTML如下:

?? ? ? ? ? ? ? ? ? ? ? ? ?......

6、如何實(shí)現(xiàn)并發(fā)執(zhí)行多個(gè)網(wǎng)絡(luò)請(qǐng)求,統(tǒng)一處理?

本方案中,利用GCD創(chuàng)建隊(duì)列組,提交多個(gè)任務(wù)到隊(duì)列組,多個(gè)任務(wù)同時(shí)執(zhí)行,監(jiān)聽(tīng)隊(duì)列組執(zhí)行完畢,在主線程刷新UI。

注意:dispatch_group_enter() 、 dispatch_group_leave()將隊(duì)列組中的任務(wù)未執(zhí)行完畢的任務(wù)數(shù)目加減1(兩個(gè)函數(shù)要配合使用)

示例:

-?(void)exampleMoreNetwork{


????dispatch_group_t?group?=?dispatch_group_create();

????dispatch_queue_t?serialQueue?=?dispatch_queue_create("magic_gcd_group",?DISPATCH_QUEUE_SERIAL);


????//?網(wǎng)絡(luò)請(qǐng)求1

????dispatch_group_enter(group);

????dispatch_group_async(group,?serialQueue,?^{

????????[[MagicNetworkManager?shareManager]?GET:@"網(wǎng)絡(luò)請(qǐng)求1"?Parameters:nil?Success:^(NSURLResponse?*response,?id?responseObject)?{

????????????dispatch_group_leave(group);

????????}?Failure:^(NSURLResponse?*response,?id?error)?{

????????????dispatch_group_leave(group);

????????}];

????});


????//?網(wǎng)絡(luò)請(qǐng)求2

????dispatch_group_enter(group);

????dispatch_group_async(group,?serialQueue,?^{

????????[[MagicNetworkManager?shareManager]?GET:@"網(wǎng)絡(luò)請(qǐng)求2"?Parameters:nil?Success:^(NSURLResponse?*response,?id?responseObject)?{

????????????dispatch_group_leave(group);

????????}?Failure:^(NSURLResponse?*response,?id?error)?{

????????????dispatch_group_leave(group);

????????}];

????});


????//?所有網(wǎng)絡(luò)請(qǐng)求結(jié)束

????dispatch_group_notify(group,?serialQueue,?^{

????????dispatch_async(dispatch_get_global_queue(0,?0),?^{

????????????dispatch_async(dispatch_get_main_queue(),?^{

????????????????//?主線程刷新UI

????????????});

????????});

????});


}

圖文混排——核心

目錄結(jié)構(gòu)

實(shí)現(xiàn)代理方法,放大圖片,跳轉(zhuǎn)商品,置頂。

實(shí)現(xiàn)針對(duì)showjoy.com域名,圖片url拼接.webp。

實(shí)現(xiàn)UIScrollView作為根容器,自適應(yīng)內(nèi)容高度。

實(shí)現(xiàn)UIWebView支持webp格式圖片。

實(shí)現(xiàn)自定義HTML代碼,圖片居中,window.location.href事件傳遞selectIndex,UIWebView代理攔截selectIndex。

通過(guò)HTML,JavaScript,還可以實(shí)現(xiàn)更多功能。。。。。。

ProductLoadMorePicTextView.h

#import?#import?"ProductDetailModel.h"

#import?"ProductLoadMorePicTextModel.h"

@protocol?ProductLoadMorePicTextViewDelegate?-?(void)productLoadMorePicTextViewZoomImageWithIndex:(NSInteger)index;

-?(void)productLoadMorePicTextViewPushProductWithSkuId:(NSString?*)skuId;

-?(void)productLoadMorePicTextViewGoTop;

@end

@interface?ProductLoadMorePicTextView?:?UIView

@property?(nonatomic,?weak)?id??delegate;

-?(instancetype)initWithFrame:(CGRect)frame?productDetailModel:(ProductDetailModel?*)productDetailModel?picTextModel:(ProductLoadMorePicTextModel?*)picTextModel;

-?(void)reload;

@end

ProductLoadMorePicTextView.m

#import?"ProductLoadMorePicTextView.h"

#import?"ProductLoadMorePicTextCollectionViewCell.h"

#import?"MagicScrollPageRefreshHeader.h"

#import?static?const?CGFloat?recommendViewHeight?=?170.0;

static?const?CGFloat?recommendViewSpace?=?10.0;

static?const?CGFloat?recommendItemWidth?=?105.0;

static?const?CGFloat?recommendItemSpace?=?5.0;

static?const?CGFloat?recommendTitleHeight?=?40.0;

@interface?ProductLoadMorePicTextView?()@property?(nonatomic,?strong)?UIScrollView?*scrollView;

@property?(nonatomic,?strong)?UIWebView?*webView;

@property?(nonatomic,?strong)?UICollectionView?*collectionView;

@property?(nonatomic,?strong)?UILabel?*recommendLabel;

@property?(nonatomic,?strong)?NSMutableArray?*recommendDataArray;

@property?(nonatomic,?strong)?NSMutableArray?*picTextDataArray;

@end

@implementation?ProductLoadMorePicTextView

-?(instancetype)initWithFrame:(CGRect)frame?productDetailModel:(ProductDetailModel?*)productDetailModel?picTextModel:(ProductLoadMorePicTextModel?*)picTextModel

{

????self?=?[super?initWithFrame:frame];

????if?(self)?{

????????self.recommendDataArray?=?[NSMutableArray?arrayWithArray:productDetailModel.recommend];

????????self.picTextDataArray?=?[NSMutableArray?arrayWithArray:picTextModel.itemPic.packageImages];

????????[self?createSubViewsWithPicTextModel:picTextModel];

????}

????return?self;

}

-?(void)createSubViewsWithPicTextModel:(ProductLoadMorePicTextModel?*)picTextModel

{

????[self?addSubview:self.scrollView];

????[[MagicWebViewWebPManager?shareManager]?registerMagicURLProtocolWebView:self.webView];

????[self.scrollView?addSubview:self.webView];

????[self.scrollView?addSubview:self.recommendLabel];

????[self.scrollView?addSubview:self.collectionView];

????[self.webView.scrollView?addObserver:self?forKeyPath:@"contentSize"?options:NSKeyValueObservingOptionNew?context:nil];


????MC_SELF_WEAK(self)

????MagicScrollPageRefreshHeader?*header?=?[MagicScrollPageRefreshHeader?headerWithRefreshingBlock:^{

????????[weakself.scrollView.mj_header?endRefreshing];

????????[weakself?executeProductLoadMorePicTextViewGoTop];

????}];

????self.scrollView.mj_header?=?header;

}

#pragma?mark?-Lazy

-?(UIScrollView?*)scrollView

{

????if?(!_scrollView)?{

????????_scrollView?=?[[UIScrollView?alloc]?initWithFrame:CGRectMake(0,?0,?self.frame.size.width,?self.frame.size.height)];

????????_scrollView.backgroundColor?=?[UIColor?colorWithRed:0.95?green:0.95?blue:0.95?alpha:1.00];

????}

????return?_scrollView;

}

-?(UIWebView?*)webView

{

????if?(!_webView)?{

????????_webView?=?[[UIWebView?alloc]?initWithFrame:CGRectMake(0,?0,?self.frame.size.width,?self.frame.size.height)];

????????_webView.delegate?=?self;

????????_webView.scrollView.bounces?=?NO;

????????_webView.scrollView.showsHorizontalScrollIndicator?=?NO;

????????_webView.scrollView.scrollEnabled?=?NO;

????????_webView.scalesPageToFit?=?YES;

????}

????return?_webView;

}

-?(UILabel?*)recommendLabel{

????if?(!_recommendLabel)?{

????????_recommendLabel?=?[[UILabel?alloc]?init];

????????_recommendLabel.text?=?@"???更多推薦";

????????_recommendLabel.textColor?=?[UIColor?colorWithRed:0.30?green:0.30?blue:0.30?alpha:1.00];

????????_recommendLabel.font?=?[UIFont?systemFontOfSize:12];

????????_recommendLabel.backgroundColor?=?[UIColor?whiteColor];

????}

????return?_recommendLabel;

}

-?(UICollectionView?*)collectionView

{

????if?(!_collectionView)?{

????????UICollectionViewFlowLayout?*flowLayout?=?[UICollectionViewFlowLayout?new];

????????flowLayout.sectionInset?=?UIEdgeInsetsMake(0,?0,?0,?recommendItemSpace);

????????flowLayout.scrollDirection?=?UICollectionViewScrollDirectionHorizontal;

????????flowLayout.itemSize?=?CGSizeMake(recommendItemWidth,?recommendViewHeight);

????????_collectionView?=?[[UICollectionView?alloc]?initWithFrame:CGRectZero?collectionViewLayout:flowLayout];

????????_collectionView.backgroundColor?=?[UIColor?whiteColor];

????????_collectionView.delegate?=?self;

????????_collectionView.dataSource?=?self;

????????[_collectionView?registerClass:[ProductLoadMorePicTextCollectionViewCell?class]?forCellWithReuseIdentifier:@"cell"];

????}

????return?_collectionView;

}

-?(void)observeValueForKeyPath:(NSString?*)keyPath?ofObject:(id)object?change:(NSDictionary?*)change?context:(void?*)context

{

????if?([keyPath?isEqualToString:@"contentSize"])?{

????????CGSize?resize?=?[self.webView?sizeThatFits:CGSizeZero];

????????self.webView.frame?=??CGRectMake(0,?0,?CGRectGetWidth(self.frame),?resize.height);

????????self.recommendLabel.frame?=?CGRectMake(0,?CGRectGetMaxY(self.webView.frame)?+?recommendViewSpace,?CGRectGetWidth(self.frame),?recommendTitleHeight);

????????self.collectionView.frame?=?CGRectMake(0,?CGRectGetMaxY(self.recommendLabel.frame),?CGRectGetWidth(self.frame),?recommendViewHeight);

????????self.scrollView.contentSize?=?CGSizeMake(CGRectGetWidth(self.frame),?CGRectGetMaxY(self.collectionView.frame)?+?recommendViewSpace);

????}

}

-(void)dealloc

{

????[[MagicWebViewWebPManager?shareManager]?unregisterMagicURLProtocolWebView:self.webView];

????[self.webView.scrollView?removeObserver:self?forKeyPath:@"contentSize"];

????self.scrollView?=?nil;

????self.webView?=?nil;

????self.collectionView?=?nil;

????self.recommendDataArray?=?nil;

????self.picTextDataArray?=?nil;

}

#pragma?mark?-?UIWebViewDelegate

-?(BOOL)webView:(UIWebView?*)webView?shouldStartLoadWithRequest:(NSURLRequest?*)request?navigationType:(UIWebViewNavigationType)navigationType{

????return?[self?handleWebviewEventWithRequest:request];

}

-?(void)webViewDidStartLoad:(UIWebView?*)webView

{


}

-?(void)webViewDidFinishLoad:(UIWebView?*)webView

{


}

-?(void)webView:(UIWebView?*)webView?didFailLoadWithError:(NSError?*)error

{

????NSLog(@"商品詳情web錯(cuò)誤?%@",?error);

}

-?(BOOL)handleWebviewEventWithRequest:(NSURLRequest?*)request

{

????NSString?*url?=?request.URL.absoluteString;

????NSRange?range?=?[url?rangeOfString:@"selectIndex="];

????if?(range.location?!=?NSNotFound)?{

????????NSInteger?begin?=?range.location?+?range.length;

????????NSString?*index?=?[url?substringFromIndex:begin];

????????[self?executeProductLoadMorePicTextViewZoomImageWithIndexString:index];

????????return?NO;

????}

????return?YES;

}

#pragma?mark?-?CustomHTML

-?(void)loadWebViewCustomHTMLWithImageUrls:(NSArray?*)imageUrls

{

????NSMutableString?*html?=?[NSMutableString?string];

????[html?appendString:@""];

????[html?appendString:@""];

????[html?appendString:@""];

????[html?appendString:@""];

????[html?appendString:[self?settingWebViewBodyWithImageUrlArray:imageUrls]];

????[html?appendString:@""];

????[html?appendString:@""];

????[self.webView?loadHTMLString:html?baseURL:nil];

}

-?(NSString?*)settingWebViewBodyWithImageUrlArray:(NSArray?*)imageUrlArray

{

????NSMutableString?*body?=?[NSMutableString?string];

????for?(NSInteger?i?=?0;?i?<?imageUrlArray.count;?i++)?{

????????NSString?*imgUrl?=?[NSString?stringWithFormat:@"%@",?[imageUrlArray?objectAtIndex:i]];

????????imgUrl?=?[self?handlerImgUrlString:imgUrl];

????????NSMutableString?*html?=?[NSMutableString?string];

????????[html?appendString:@""];

????????NSString?*onload?=?[NSString?stringWithFormat:@"this.onclick?=?function()?{window.location.href?=?'selectIndex='?+?%ld;}",?i];

????????[html?appendFormat:@"",?onload,?imgUrl];

????????[html?appendString:@""];

????????[body?appendString:html];

????}

????return?body;

}

#pragma?mark?-UICollectionViewDataSource

-?(NSInteger)collectionView:(UICollectionView?*)collectionView?numberOfItemsInSection:(NSInteger)section{

????return?self.recommendDataArray.count;

}

-?(UICollectionViewCell?*)collectionView:(UICollectionView?*)collectionView?cellForItemAtIndexPath:(NSIndexPath?*)indexPath{

????ProductLoadMorePicTextCollectionViewCell?*cell?=?(ProductLoadMorePicTextCollectionViewCell?*)[collectionView?dequeueReusableCellWithReuseIdentifier:@"cell"?forIndexPath:indexPath];

????cell.productRecommendModel?=?[self.recommendDataArray?objectAtIndex:indexPath.row];

????return?cell;

}

#pragma?mark?-UICollectionViewDelegate

-?(void)collectionView:(UICollectionView?*)collectionView?didSelectItemAtIndexPath:(NSIndexPath?*)indexPath{

???ProductRecommend?*productRecommendModel?=?[self.recommendDataArray?objectAtIndex:indexPath.row];

???[self?executeProductLoadMorePicTextViewPushProductWithSkuId:productRecommendModel.ID];

}

#pragma?mark?-ProductLoadMoreViewDelegate

-?(void)executeProductLoadMorePicTextViewZoomImageWithIndexString:(NSString?*)indexString

{

????if?([self.delegate?respondsToSelector:@selector(productLoadMorePicTextViewZoomImageWithIndex:)])?{

????????[self.delegate?productLoadMorePicTextViewZoomImageWithIndex:[indexString?integerValue]];

????}

}

-?(void)executeProductLoadMorePicTextViewPushProductWithSkuId:(NSInteger)skuId

{

????if?([self.delegate?respondsToSelector:@selector(productLoadMorePicTextViewPushProductWithSkuId:)])?{

????????[self.delegate?productLoadMorePicTextViewPushProductWithSkuId:[NSString?stringWithFormat:@"%ld",?skuId]];

????}

}

-?(void)executeProductLoadMorePicTextViewGoTop

{

????if?([self.delegate?respondsToSelector:@selector(productLoadMorePicTextViewGoTop)])?{

????????[self.delegate?productLoadMorePicTextViewGoTop];

????}

}

#pragma?mark?-?Reload

-?(void)reload{

????[self?loadWebViewCustomHTMLWithImageUrls:self.picTextDataArray];

????[self.collectionView?reloadData];

}

#pragma?mark?-?IMGURL

-?(NSString?*)handlerImgUrlString:(NSString?*)imgUrlString

{

????NSString?*result?=?[NetworkManager?httpsSchemeHandler:imgUrlString];

????//?webp

????if?([result?containsString:@"showjoy.com"]?&&?![result?hasSuffix:@".webp"])?{

????????result?=?[result?stringByAppendingString:@".webp"];

????}

????return?result;

}

@end

圖文混排——使用

ProductLoadMoreViewController中,保證兩個(gè)接口都請(qǐng)求完成后,刷新ProductLoadMorePicTextView。

#import?"ProductLoadMoreViewController.h"

#import?"MagicNetworkManager.h"

#import?"ProductLoadMorePicTextView.h"

static?NSString?*?const?SJProductAPI?=?@"https://shopappserver.showjoy.com/api/shop/sku";

static?NSString?*?const?SJProductPicTextAPI?=?@"https://shopappserver.showjoy.com/api/shop/item/pictext";

static?NSString?*?const?SJProductSkuId?=?@"146931";

@interface?ProductLoadMoreViewController?()?@end

@implementation?ProductLoadMoreViewController{

????ProductDetailModel?*_productModel;

????ProductLoadMorePicTextModel?*_productPicTextModel;

????ProductLoadMorePicTextView?*_picTextView;

}

-?(void)viewDidLoad?{

????[super?viewDidLoad];

????//?Do?any?additional?setup?after?loading?the?view.

????self.view.backgroundColor?=?[UIColor?grayColor];

????[self?networkRequestData];

}

#pragma?mark?-?Network

-?(void)networkRequestData

{

???[QuicklyHUD?showWindowsProgressHUDText:@"加載中..."];

????dispatch_group_t?group?=?dispatch_group_create();

????dispatch_queue_t?serialQueue?=?dispatch_queue_create("product_group",?DISPATCH_QUEUE_SERIAL);


????//?商品信息

????dispatch_group_enter(group);

????dispatch_group_async(group,?serialQueue,?^{

????????[[MagicNetworkManager?shareManager]?GET:SJProductAPI?Parameters:@{@"skuId"?:?SJProductSkuId}?Success:^(NSURLResponse?*response,?id?responseObject)?{

????????????[ProductDetailModel?mj_setupObjectClassInArray:^NSDictionary?*{

????????????????return?@{@"shop"?:?[ProductShop?class],

?????????????????????????@"skuList"?:?[ProductSkuList?class],

?????????????????????????@"value"?:?[ProductValue?class],

?????????????????????????@"saleInfo"?:?[ProductSaleInfo?class],

?????????????????????????@"recommend"?:?[ProductRecommend?class],

?????????????????????????@"skuCommission"?:?[ProductSkuCommission?class],

?????????????????????????@"item"?:?[ProductItem?class],

?????????????????????????@"tagSkus"?:?[ProductTagSkus?class],

?????????????????????????@"tagMap"?:?[ProductTagMap?class],

?????????????????????????@"skuEnsures"?:?[ProductSkuEnsures?class],

?????????????????????????@"salesPromotion"?:?[ProductSalesPromotion?class]};

????????????}];

????????????_productModel?=?[ProductDetailModel?mj_objectWithKeyValues:[responseObject?valueForKey:@"data"]];

????????????dispatch_group_leave(group);

????????}?Failure:^(NSURLResponse?*response,?id?error)?{

????????????dispatch_group_leave(group);

????????}];

????});


????//?圖文信息

????dispatch_group_enter(group);

????dispatch_group_async(group,?serialQueue,?^{

????????[[MagicNetworkManager?shareManager]?GET:SJProductPicTextAPI?Parameters:@{@"skuId"?:?SJProductSkuId}?Success:^(NSURLResponse?*response,?id?responseObject)?{

????????????[ProductLoadMorePicTextModel?mj_setupObjectClassInArray:^NSDictionary?*{

????????????????return?@{@"item"?:?[PicTextItem?class],

?????????????????????????@"itemPic"?:?[PicTextItemPic?class],

?????????????????????????@"spu"?:?[PicTextSpu?class]};

????????????}];

????????????_productPicTextModel?=?[ProductLoadMorePicTextModel?mj_objectWithKeyValues:[responseObject?valueForKey:@"data"]];

????????????dispatch_group_leave(group);

????????}?Failure:^(NSURLResponse?*response,?id?error)?{

????????????dispatch_group_leave(group);

????????}];

????});


????//?主線程刷新UI

????dispatch_group_notify(group,?serialQueue,?^{

????????dispatch_async(dispatch_get_global_queue(0,?0),?^{

????????????dispatch_async(dispatch_get_main_queue(),?^{

????????????????[QuicklyHUD?hiddenMBProgressHUDForView:MC_APP_WINDOW];

????????????????[self?reloadPicTextView];

????????????});

????????});

????});?

}

#pragma?mark?-?Reload

-?(void)reloadPicTextView

{

????if?(_picTextView)?{

????????[_picTextView?removeFromSuperview];

????????_picTextView.delegate?=?nil;

????????_picTextView?=?nil;

????}

????CGFloat?border?=?20.0f;

????_picTextView?=?[[ProductLoadMorePicTextView?alloc]?initWithFrame:CGRectMake(border,?border,?MC_SCREEN_W?-?2?*?border,?MC_SCREEN_H?-?MC_NAVIGATION_BAR_H?-?MC_STATUS_BAR_H?-?2?*?border)?productDetailModel:_productModel?picTextModel:_productPicTextModel];

????_picTextView.delegate?=?self;

????[self.view?addSubview:_picTextView];

????[_picTextView?reload];

}

#pragma?mark?-?ProductLoadMorePicTextViewDelegate

-?(void)productLoadMorePicTextViewGoTop

{

????[QuicklyHUD?showWindowsOnlyTextHUDText:@"Go?Top"];

}

-?(void)productLoadMorePicTextViewZoomImageWithIndex:(NSInteger)index

{

????[QuicklyHUD?showWindowsOnlyTextHUDText:[NSString?stringWithFormat:@"img:?%ld",?index]];

}

-?(void)productLoadMorePicTextViewPushProductWithSkuId:(NSString?*)skuId

{

????[QuicklyHUD?showWindowsOnlyTextHUDText:[NSString?stringWithFormat:@"skuId:?%@",?skuId]];

}

@end

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容