2011-07-05 27 views

回答

0

编辑:我不知道我怎么能做到这一点,但我看错UILabelUIButton ...这里的修正答案...

我想,MS公式编辑可以产生PNG,JPEG, GIF或bmp(windows格式)图像的等式。

在这种情况下,您可以将图像作为子视图添加到UILabel

NSString* pathToEquation = [[NSBundle mainBundle] pathForResource:@"eq" ofType:@"png"]; 
UIImage* equationImage = [UIImage imageWithContentsOfFile:pathToEquation]; 
UIImageView* equationView = [UIImageView initWithImage:equationImage]; 
equationView.frame = CGRectMake(....); // -- where the image should appear within the label 
[label addSubview:equationView]; 

这应该工作。 不要忘记将所有图像文件作为资源加入到您的项目中。

+3

或者你可以只使用UIImageView? –

+0

问题是我正在构建一个将生成多个应用程序的框架。我真的需要能够从文本中将这些文件从csv文件中提取出来,并将它们插入到标签中。 – smokingoyster