图片gallery

This commit is contained in:
life
2015-11-09 17:29:41 +08:00
parent d810141d80
commit 709c6ac835
12 changed files with 128 additions and 46 deletions

View File

@@ -535,21 +535,25 @@ BOOL hiddenBar = NO;
}
*/
// TODO action
// image gallery
- (void)showActionTapImage:(NSString *)url
{
NSArray *urlArr = [url componentsSeparatedByString:@","]; // ',', url
NSString *curUrlStr = [urlArr lastObject];
NSArray *urlArr = [url componentsSeparatedByString:@"L$L"]; // 'L$L', url
//
int curUrlIndex = [[urlArr lastObject] intValue];
NSMutableArray *realUrls = [[NSMutableArray alloc] init];
// fix url,
for(int i = 0; i < [urlArr count] - 1; ++i) {
NSString *each = urlArr[i];
NSString *fileId = [Common getFileIdFromUrl:each];
if(fileId || [LeaImageViewController isUrlSupported:[NSURL URLWithString:each]]) {
// , , .png
// NSString *fileId = [Common getFileIdFromUrl:each];
// if(fileId || [LeaImageViewController isUrlSupported:[NSURL URLWithString:each]]) {
[realUrls addObject:each];
}
// }
}
// url
@@ -557,7 +561,13 @@ BOOL hiddenBar = NO;
if(count < 1) {
return;
}
if (curUrlIndex > count) {
curUrlIndex = 0;
}
/*
int curIndex = 0;
// url?
NSString *curUrl = realUrls[0];
for(int i = 0; i < count; ++i) {
NSString *each = realUrls[i];
@@ -567,11 +577,12 @@ BOOL hiddenBar = NO;
break;
}
}
*/
LeaImageSliderViewController *vc2 = [[LeaImageSliderViewController alloc] init];
vc2.curUrl = curUrl;
vc2.urlArr = realUrls;
vc2.curIndex = curIndex;
vc2.curUrl = realUrls[curUrlIndex];
[vc2 setUrlArr:realUrls];
vc2.curIndex = curUrlIndex;
vc2.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
vc2.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:vc2 animated:YES completion:nil];