I want to get the image from the UIBezierpath
closed path(See the image). I draw the image on the UIView
using drawRect
method and also draw the lines are using the drawRect
method.
How can I get the particular closed path image? Please help me. Thanks in advance.
This code used for draw the bezierpath.
UIBezierPath *aPath = [UIBezierPath bezierPath];
for (NSString *pointString in pointArray) {
if ([pointArray indexOfObject:pointString] == 0)
[aPath moveToPoint:CGPointFromString(pointString)];
else
[aPath addLineToPoint:CGPointFromString(pointString)];
}
[aPath closePath];
Run Code Online (Sandbox Code Playgroud)
我需要检测iPhone中的EDGE网络和坏网络.
1)如何检测坏网络?
2)是否有可能检测到EDGE网络?
3)我如何获得网络的力量?
请对这些问题给出一些答案.提前致谢.
- (UIImage *)imageByCropping:(UIImage *)imageToCrop toRect:(CGRect)rect
{
CGImageRef imageRef = CGImageCreateWithImageInRect([imageToCrop CGImage], rect);
UIImage *cropped = [UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);
return cropped;
}
Run Code Online (Sandbox Code Playgroud)
我正在使用此代码.请给出一些解决方案.谢谢
我想一般创建UIView.并在所有视图控制器中使用该视图.如何使用xib创建UIView子类并在所有视图控制器中使用?提前致谢.
我想减少时间的倒计时.因此,如果用户最小化应用,则应用加载背景.如何在应用程序后台运行计时器?我使用以下代码.当app最小化时,计时器停止.请帮我.
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerCountDown) userInfo:nil repeats:YES];
- (void)timerCountDown
{
if(secondsLeft > 0 ) {
secondsLeft -- ;
hours = secondsLeft / 3600;
minutes = (secondsLeft % 3600) / 60;
seconds = (secondsLeft %3600) % 60;
}
}
Run Code Online (Sandbox Code Playgroud) MPMoviePlayerController视频在屏幕为黑色时进入全屏模式.然后应用程序被阻止了.此问题仅适用于iOS 6.0.但iOS 5.1工作正常.这是我的代码.如果我双击播放器全屏打开,但显示黑屏.
self.moviePlayerController = [[MPMoviePlayerController alloc] init];
[self.moviePlayerController.view setFrame:_moviePlayerContentView.bounds];
[self.moviePlayerController setControlStyle:MPMovieControlStyleNone];
[self.moviePlayerController setAllowsAirPlay:NO];
[_moviePlayerContentView addSubview:self.moviePlayerController.view];
[self.moviePlayerController stop];
[self.moviePlayerController setContentURL:videoURL];
[self.moviePlayerController.view setHidden:NO];
[self.moviePlayerController prepareToPlay];
[self.moviePlayerController play];
Run Code Online (Sandbox Code Playgroud)
我该如何处理这个问题?
达到MPMovieFinishReasonPlaybackEnded后,如何禁用全屏模式?
请帮我.提前致谢.
如何在UIImageView上画一条线?我正在使用UIImageView子类,它不支持drawRect:
方法.我想在图像视图上画一条线.我怎样才能做到这一点?请帮我.我在下面的代码中使用绘制线.
- (void)drawRect:(CGRect)rect {
CGContextRef c = UIGraphicsGetCurrentContext();
CGFloat red[4] = {1.0f, 0.0f, 0.0f, 1.0f};
CGContextSetStrokeColor(c, red);
CGContextBeginPath(c);
CGContextMoveToPoint(c, 5.0f, 5.0f);
CGContextAddLineToPoint(c, 50.0f, 50.0f);
CGContextStrokePath(c);
}
Run Code Online (Sandbox Code Playgroud) iphone ×7
ios ×4
xcode ×2
ios6 ×1
networking ×1
objective-c ×1
uibezierpath ×1
uiimageview ×1
uiview ×1