我想在不使用UIWebView的情况下在iPhone中渲染SVG图像.我怎样才能做到这一点?
我检查了这两个链接:
http://www.splashdust.net/2010/09/svgquartzrenderer-a-basic-iphone-sdk-compatible-svg-renderer/ https://github.com/splashdust/SVGQuartzRenderer
Github上面的项目显示了102个错误,显示UIKit框架丢失,其他人也无法添加该框架.我认为该应用程序适用于MacOS而不适用于iOS.
http://maniacdev.com/2011/05/open-source-library-to-render-svg-graphics-as-core-animation-layers/
https://github.com/mattrajca/SVGKit
上面url上的项目显示了构建项目时的错误.
Target指定产品类型'com.apple.product-type.framework',但'iPhoneOS'平台没有这种产品类型.
有谁知道如何解决这个问题?或者我可以使用的其他有用的工作示例?我想在iPhone上渲染SVG.
更新:我通过阅读说明工作SVGKit.但当我试图让我从Github(https://github.com/splashdust/SVGQuartzRenderer )下载的项目工作时,我遇到以下错误:
1)UIKit/UIKit.h:没有这样的文件或目录(我无法使用添加现有框架添加它)
2)Libxml/tree.h:没有这样的文件或目录
3)Expected specifier-qualifier-listbefore'xmlParserCtxtPtr' .有谁知道如何解决它并使其工作?
我有8个用于密码的uitextfields.每个文本字段包含密码中的一个字母.当我输入一个字母后,当我按下第二个键时,焦点移动到下一个文本字段.但我想要的是,一旦我完成第一个字符的输入,焦点应该移动到下一个文本字段而不按其他键或按Tab键.我怎样才能做到这一点?任何示例代码教程?我使用的代码如下.
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(keyPressed:) name: UITextFieldTextDidChangeNotification object: nil];
// Try to find next responder
UIResponder* nextResponder = [textField.superview viewWithTag:nextTag];
if (nextResponder) {
// Found next responder, so set it.
//nextTag += 1;
[nextResponder becomeFirstResponder];
if ([nextResponder tag] == 308) {
//[self performSelector:@selector(checkPassCode) withObject:nil afterDelay:0.0];
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(checkPassCode) userInfo:nil repeats:NO];
lastResponder = nextResponder;
}
return YES;
} else {
[textField resignFirstResponder];
return NO;
}
}
-(void) keyPressed: (NSNotification*) notification
{ …Run Code Online (Sandbox Code Playgroud)