Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.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
Iphone 目标-C“;《星球大战》;开口爬行_Iphone_Ios_Objective C_Ipad - Fatal编程技术网

Iphone 目标-C“;《星球大战》;开口爬行

Iphone 目标-C“;《星球大战》;开口爬行,iphone,ios,objective-c,ipad,Iphone,Ios,Objective C,Ipad,如何在iOS上完成《星球大战》的开场抓取? 我试着在CSS3(3D变换)上做,但速度非常慢。 有可能在Objective-C上完成吗 请演示如何用Objective-C书写 这在Objective-C中是可能的 只是因为我很好 我们将从一个简单的旋转开始,看看会发生什么。如果你建立,你会看到我们有一个很好的旋转,但它看起来不现实。我们也需要改变视角以获得真正的效果 UITextView *textView = [[UITextView alloc] initWithFrame:self.view

如何在iOS上完成《星球大战》的开场抓取? 我试着在CSS3(3D变换)上做,但速度非常慢。 有可能在Objective-C上完成吗


请演示如何用Objective-C书写

这在Objective-C中是可能的

只是因为我很好

我们将从一个简单的旋转开始,看看会发生什么。如果你建立,你会看到我们有一个很好的旋转,但它看起来不现实。我们也需要改变视角以获得真正的效果

UITextView *textView = [[UITextView alloc] initWithFrame:self.view.bounds];
[textView setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth];
[textView setBackgroundColor:[UIColor blueColor]];

[textView setText:@"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."];

[textView setFont:[UIFont boldSystemFontOfSize:32.0]];
[textView setTextAlignment:NSTextAlignmentCenter];

// Rotate the text
[textView.layer setTransform:CATransform3DMakeRotation(M_PI_4, 1.0, 0.0, 0.0)];

// Now we need to skew the box so the bottom is wider than the top.

[self.view addSubview:textView];
快到了

好的,在谷歌搜索了一下之后,我们已经找到了如何调整
cattransferm3d
的m34值来调整我们正在寻找的透视图。也使颜色正确!建造它,你就会清楚地看到我们要去哪里。但是我们需要调整框架以确保它填满屏幕。然后我们可以添加一些自动滚动动画,这样我们就不必用手指滚动了

// Learn the basics of matrix transforms: http://markpospesel.wordpress.com/tag/catransform3d/

UITextView *textView = [[UITextView alloc] initWithFrame:CGRectInset(self.view.bounds, 32.0, 32.0)];
[textView setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth];
[textView setBackgroundColor:[UIColor blackColor]];
[textView setTextColor:[UIColor yellowColor]];
[textView setEditable:NO];

[textView setText:@"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."];

[textView setFont:[UIFont boldSystemFontOfSize:36.0]];
[textView setTextAlignment:NSTextAlignmentCenter];

// Start with a blank transform
CATransform3D blankTransform = CATransform3DIdentity;

// Skew the text
blankTransform.m34 = -1.0 / 500.0;

// Rotate the text
blankTransform = CATransform3DRotate(blankTransform, 45.0f * M_PI / 180.0f, 1.0f, 0.0f, 0.0f);

// Set the transform
[textView.layer setTransform:blankTransform];

[self.view addSubview:textView];

你能举个例子吗?你能展示你尝试过的吗?+1因为这从技术上回答了他的问题。但是我会假设并添加一些东西来帮助他们,或者向他们指出方向。我尝试了这个例子:嗯,不确定我应该向上投票还是向下投票:),从技术上讲,这是正确的,尽管=D,我会保持中立。