icanzilb / MTPopupWindow

Popup-window style view for Objective-C, which loads contents of an HTML file. Easy one-line usage. Check the readme for example
http://www.touch-code-magazine.com/showing-a-popup-window-in-ios6-modernized-tutorial-code-download/
84 stars 26 forks source link

Show image from url #4

Closed maorbenamer closed 11 years ago

maorbenamer commented 11 years ago

Hi, I need help to show an image from a URL in the popup window. could you please help with the code?

icanzilb commented 11 years ago

what have you tried so far?

maorbenamer commented 11 years ago

Ive get an image from URL and called it *data. and then I tried this code:

//show local file MTPopupWindow* winPop = [MTPopupWindow alloc]init]; UIImage image = [UIImage imageWithData:data]; UIColor c = [UIColor colorWithPatternImage:image]; winPop.backgroundColor = c;

icanzilb commented 11 years ago

I have problems to understand why do you do that ... The popup window meant to show an HTML file - that's why it uses a web view control to show the content.

Btw - did you try to just pass the URL to the image to showWindowWithHTMLFile: ? I guess if you do that it'll just take the image URL and show it in the web view control.

maorbenamer commented 11 years ago

Thanks!

I tried to enter the image URL to showWindowWithHTMLFile: and its work. but, could i stretch the image to the popup size?

icanzilb commented 11 years ago

not automatically