Dear all!!
In order to display content of file (text data) , I have written the code as:
And this is working properly. File contents are displayed properly on viewer.
Now I want to display some image (png/jpeg) on some viewer again. I am trying to display images of dimension 250*250 pixels. And using the code like:
But there is no image on viewer.Nothing happens!!
Am I making any mistake?
Thanks
In order to display content of file (text data) , I have written the code as:
Code:
- (void) textviewtest {
CGRect frame1 = CGRectMake(10, 10, 300, 400);
textview = [[[UITextView alloc] initWithFrame:frame1 ] autorelease];
textview.backgroundColor =[UIColor orangeColor];
textview.autocorrectionType =YES;
textview.editable = NO;
textview.clipsToBounds = NO;
[textview setText: fileString ];
[textview setFont:[UIFont fontWithName:@"Helvetica" size:16.0]];
[[self view] addSubview : textview ];
}
And this is working properly. File contents are displayed properly on viewer.
Now I want to display some image (png/jpeg) on some viewer again. I am trying to display images of dimension 250*250 pixels. And using the code like:
Code:
CGRect rect=CGRectMake(10,10,300,400);
UIImageView *image=[[[UIImageView alloc]initWithFrame:rect] autorelease];
image.backgroundColor =[UIColor redColor];
NSLog(@"reading image");
[image setImage:[UIImage imageNamed:@"/Users/sagar/scrshot.png"]];
[[self view] addSubview: image];
But there is no image on viewer.Nothing happens!!
Am I making any mistake?
Thanks