根据Apple的文档,为了从我的应用程序拨打电话,我需要实现以下协议:
HTML链接:
<a href="tel:1-408-555-5555">1-408-555-5555</a>
Run Code Online (Sandbox Code Playgroud)
原生应用URL字符串:
tel:1-408-555-5555
Run Code Online (Sandbox Code Playgroud)
但是,在完成从UIWebView内的HTML链接发起的电话呼叫后,我将重定向到我的应用程序.但是在完成从本机应用程序URL字符串进行的电话呼叫后,我的iphone会保留在iphone的常规电话应用程序中,如果我想返回我的应用程序,我必须手动执行此操作.
据我所知,通过阅读其他人所说的话,没有办法改变这种行为.
这是我的问题:
我正在做一个绘图项目,有一个橡皮擦选项。下面给出的代码适用于当我启动我的应用程序并绘制一些线并继续使用橡皮擦时。它工作正常,我得到了橡皮擦效果。现在,第二种情况是,我绘制10条线,然后单击“撤消按钮”并撤消整个操作,然后重做整个操作,现在单击“橡皮擦按钮”并尝试擦除某些部分,但是它将清除整个图形。这就是我要设法解决的问题,但是我不明白我要去哪里错了,所以朋友们请帮帮我。
下面是我的代码。
- (void)drawRect:(CGRect)rect
{
case DRAW:
{
[m_curImage drawAtPoint:CGPointMake(0, 0)];
CGPoint mid1 = midPoint(m_previousPoint1, m_previousPoint2);
CGPoint mid2 = midPoint(m_currentPoint, m_previousPoint1);
CGContextRef context = UIGraphicsGetCurrentContext();
[self.layer renderInContext:context];
CGContextMoveToPoint(context, mid1.x, mid1.y);
CGContextAddQuadCurveToPoint(context, m_previousPoint1.x, m_previousPoint1.y, mid2.x, mid2.y);
CGContextSetLineCap(context, kCGLineCapRound);
CGContextSetLineWidth(context, self.lineWidth);
CGContextSetStrokeColorWithColor(context, self.lineColor.CGColor);
CGContextSetAlpha(context, self.lineAlpha);
CGContextSetAllowsAntialiasing(context, YES);
CGContextStrokePath(context);
// [super drawRect:rect];
}
break;
case ERASE:
{
[m_curImage drawAtPoint:CGPointMake(0, 0)];
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextClearRect(context, rect);
CGContextSetBlendMode(context, kCGBlendModeClear);
[super drawRect:rect];
break;
}
case UNDO:
{
[m_curImage drawInRect:self.bounds];
break;
}
case REDO:
{
[m_curImage …Run Code Online (Sandbox Code Playgroud) 我使用了以下代码:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@", self.phoneNumber]]];
Run Code Online (Sandbox Code Playgroud)
拨打电话后,拨号器转到电话应用程序,而不是回到我的应用程序.
有任何想法吗?
iOS 7. Xcode 5.