ユーザーがDONEを押した後、テキストをUIImageViewに変換して表示します。1行のテキストで非常にうまく機能し、
およびスクリーンショット 1
. しかし、ユーザーが 2 行以上入力した場合: 結果は 1 行のままです??? スクリーンショット 2
UIimageViewで複数行表示したい
誰でも私を助けることができます!どうもありがとうございました!
これが私のコードです:
-(UIImage *)convertTextToImage : (ObjectText *) objT;
{
UIGraphicsBeginImageContext(CGSizeMake(([objT.content sizeWithFont:objT.font].width+10), ([objT.content sizeWithFont:objT.font].height+10)));
[[objT getcolor] set];
[objT.content drawAtPoint:CGPointMake(5, 5) withFont:objT.font];
UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return result;
}