Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 具有逐面板视图的漫画书_Image_Iphone - Fatal编程技术网

Image 具有逐面板视图的漫画书

Image 具有逐面板视图的漫画书,image,iphone,Image,Iphone,有没有人有主意一块一块地展示图片。目前我有一张漫画图片,在这张图片中有4个面板,我需要将这张图片分成4个面板&我想展示iPhone中按顺序排列的四个面板,有人对此有想法吗 提前谢谢。你应该看看图书馆。它还有一个非常好的翻页动画 在您的情况下,我不想修改图像,只想修改视图显示的部分。您可以在UIKit中通过更改UIScrollView的content-rect来实现这一点 或者,使用Cocos2D,您可以将每个面板视为精灵表中的精灵,并按顺序显示它们。尝试此工作解决方案。 您需要有框架/面板响应,

有没有人有主意一块一块地展示图片。目前我有一张漫画图片,在这张图片中有4个面板,我需要将这张图片分成4个面板&我想展示iPhone中按顺序排列的四个面板,有人对此有想法吗

提前谢谢。

你应该看看图书馆。它还有一个非常好的翻页动画

在您的情况下,我不想修改图像,只想修改视图显示的部分。您可以在UIKit中通过更改UIScrollView的content-rect来实现这一点


或者,使用Cocos2D,您可以将每个面板视为精灵表中的精灵,并按顺序显示它们。

尝试此工作解决方案。 您需要有框架/面板响应,并使用以下方法

    - (BOOL)zoomPanel
{
//Grab the frame from the database
CKUViewFrame* frame = [self.uview frameForPage:self.pageIndex
frame:self.frameIndex];
if (frame == nil)
{
return NO;
}
//Translate the timing
NSTimeInterval animationTime = [frame.animationDuration
doubleValue];
UIViewAnimationOptions animationOptions =
UIViewAnimationOptionBeginFromCurrentState | ([frame.animationCurve
integerValue] << 16);o
//Get the rects and convert to device coordinates
CGRect frameRectPercent = CGRectMake([frame.rectLeft floatValue],
[frame.rectTop floatValue], [frame.rectWidth floatValue],
[frame.rectHeight floatValue]);
CGRect frameRect = CGRectMake((frameRectPercent.origin.x *
self.pageImageView.image.size.width),
(frameRectPercent.origin.y *
self.pageImageView.image.size.height),
frameRectPercent.size.width *
self.pageImageView.image.size.width,
frameRectPercent.size.height *
self.pageImageView.image.size.height);
//Set the mask color
UIColor* maskColor = [UIColor colorWithRed:[frame.colorRedValue
floatValue] green:[frame.colorGreenValue floatValue] blue:
[frame.colorBlueValue floatValue] alpha:[frame.colorAlphaValue
floatValue]];
[UIView animateWithDuration:animationTime delay:0
options:animationOptions animations:^
{
//Determine the zoomScale to use
CGFloat zoomScale = self.view.bounds.size.width /
frameRect.size.width;
CGFloat verticalZoomScale = self.view.bounds.size.height /
frameRect.size.height;
if (verticalZoomScale < zoomScale)
{
zoomScale = verticalZoomScale;
}
//Determine the offset to use
CGFloat heightOffset = (((frameRect.size.height * zoomScale)
- (self.pageScrollView.bounds.size.height)) / 2);
CGFloat widthOffset = (((frameRect.size.width * zoomScale) -
(self.pageScrollView.bounds.size.width)) / 2);
self.pageScrollView.zoomScale = zoomScale;
self.pageScrollView.contentOffset = CGPointMake(widthOffset +
(frameRect.origin.x * zoomScale), heightOffset + (frameRect.origin.y *
zoomScale));
//Do the masking

return YES;
}
-(BOOL)zoomPanel
{
//从数据库中获取帧
CKUViewFrame*frame=[self.uview frameForPage:self.pageIndex
frame:self.frameIndex];
如果(帧==nil)
{
返回否;
}
//翻译时间
NSTimeInterval animationTime=[frame.animationDuration]
双值];
UIViewAnimationOptions动画选项=
UIViewAnimationOptionBeginFromCurrentState |([frame.animationCurve

整数值]我不想要任何动画。但我想将图像分成四个面板。每个漫画面板的图像大小都不一样。因此,如何管理?你必须查看图像并为每个漫画页面编写一个配置
.plist
。在iPhone上可能没有一种快速计算的方法。你需要在我能提供更多帮助之前,我想了解更多关于Cocos2D的信息。