我在图像视图下有两个 UIImageView 和两个文本文件。image1 的一个文本字段和 image2 的第二个文本字段。
现在我希望该用户输入文本并给出图像名称,该图像将以 .rtf 格式保存在文档目录中。当我打开 .rtf 时,我将能够编辑该 rtf。
imageView = [[UIImageView alloc] initWithFrame:CGRectMake(100,50, 100, 100)];
[imageView setImage:[UIImage imageNamed:@"image1.png"]];
self.view addSubview:imageView];
[imageView release];
imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(100,150, 100, 100)];
[imageView1 setImage:[UIImage imageNamed:@"image2.png"]];
self.view imageView1];
[imageView1 release];
txt=[[UITextField alloc]initWithFrame:CGRectMake(5,190, 180, 30)];
txt.backgroundColor=[UIColor whiteColor];
txt.placeholder=@"Enter Text";
txt.textColor = [UIColor blackColor];
txt.delegate =self;
[txt addTarget:self action:@selector(ImageSave_method) forControlEvents:UIControlEventEditingDidEnd];
txt.textAlignment=NSTextAlignmentCenter;
txt.userInteractionEnabled = YES;
txt.autocapitalizationType = NO;
txt.font=[UIFont fontWithName:@"Helvetica" size:15];
[self.view addSubview:txt];
txt2=[[UITextField alloc]initWithFrame:CGRectMake(200,190, 180, 30)];
txt2.backgroundColor=[UIColor whiteColor];
txt2.placeholder=@"Enter Text";
txt2.textColor = [UIColor blackColor];
txt2.delegate =self;
[txt2 addTarget:self action:@selector(ImageSave_method) forControlEvents:UIControlEventEditingDidEnd];
txt2.textAlignment=NSTextAlignmentCenter;
txt2.userInteractionEnabled = YES;
txt2.autocapitalizationType = NO;
txt2.font=[UIFont fontWithName:@"Helvetica" size:15];
[self.view addSubview:txt2];
我不知道该怎么做。
任何想法或建议都将受到高度欢迎。