0

I have the following code to display internal image in textview. I am trying to display external http:// link to textview.

The following code works ok. Please help me to display external weblink image.

UITextField *txtstate =[[UITextField alloc]init]; [txtstate setFrame:CGRectMake(10, 30,170, 30)];
txtstate.delegate=self;

NSString * quotStr03 = [[NSString alloc] initWithFormat:@"%@",[dict valueForKey:@"deal-image"]];
txtstate.text=quotStr03;
txtstate.borderStyle = UITextBorderStyleLine;
txtstate.background = [UIImage imageNamed:quotStr03];
[txtstate setAutocorrectionType:UITextAutocorrectionTypeNo];
[self.view addSubview:txtstate];
rmaddy
  • 314,917
  • 42
  • 532
  • 579
FAAD
  • 79
  • 3
  • 13
  • Possible duplicate of [Create a UIImage with a URL in iOS](http://stackoverflow.com/questions/7694215/create-a-uiimage-with-a-url-in-ios) – rmaddy Aug 24 '16 at 20:21

1 Answers1

0
-(UIImage *) getImageFromURL:(NSURL*) imageURL
{
  NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
  UIImage *image = [UIImage imageWithData:imageData];
  return image;
}

by providing url to this function you will get external weblink image

Sangram Shivankar
  • 3,535
  • 3
  • 26
  • 38