当我与文本共享图像时,文本将在ios应用程序中向下移动?

时间:2015-03-25 08:09:26

标签: ios xcode5

爵士         我有很棒的电子贺卡应用程序。我希望通过电子邮件发布带有动态文本的图像。当我点击动作表行中的电子邮件时,图像将会在当前发布,但文本会向下移动位置。     lable用于在image.lable上显示文本是清晰的颜色。因为我添加了字体。我们有一个绘画用于绘制图像,我们使用drawimag obj。

     [fullImageViewObj addSubview:labelObj ];
        [fullImageViewObj addSubview:drawImage];
        CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
        CGContextRef currentContext = CGBitmapContextCreate(NULL, 320, 440, 8, 0, colorSpace, (kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst));
        CGContextTranslateCTM(currentContext, 0, 440);
        CGContextScaleCTM(currentContext, 1.0, -1.0);
        [fullImageViewObj.layer renderInContext:currentContext];
        CGImageRef collageImg = CGBitmapContextCreateImage(currentContext);
        CGColorSpaceRelease(colorSpace);
        CGContextRelease(currentContext);
        [UIImagePNGRepresentation([UIImage imageWithCGImage:collageImg]) writeToFile:[self dataFilePath] atomically:YES];

        switch (buttonIndex)
        {
        case Button_Index0:
            {
                MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
                mail.mailComposeDelegate = self;    

                if([MFMailComposeViewController canSendMail])
            {
                    [mail setSubject:@"MyImage - Name"];
                    NSString *emailBody = @"";
                    [mail setMessageBody:emailBody isHTML:YES];
                    [mail addAttachmentData:UIImagePNGRepresentation([UIImage imageWithCGImage:collageImg]) mimeType:@"image/png" fileName:@"e-card.png"]; 
                    [self presentViewController:mail animated:YES completion:nil];
                }
                [mail release];
            }
                break;

这是我的ThirdScreenshot:http://i.stack.imgur.com/2Nl1z.png

这是第二个屏幕截图http://i.stack.imgur.com/Cq2CW.png

0 个答案:

没有答案