NimbleKit - fast iOS app development

How do you insert an image ?

Problem discussions

How do you insert an image ?

Postby error123 » Wed Apr 25, 2012 5:04 pm

I have a series of image files that I would like to display in my app. How do i insert one image into nimblekit which will then show the image in the main.html file? when run in the simulator. My app is all based around images which already has text written onto it.

I made the pictures to the size and scale of the iphone, well the image files are double the height to be exact. So the user will need to be able to scroll using his finger to see the entire image.

any help would be great.
error123
 
Posts: 12
Joined: Sun Feb 19, 2012 1:01 pm

Re: How do you insert an image ?

Postby ryubr » Wed Apr 25, 2012 6:30 pm

As NK is based on HTMl + Javascript, you can simply add a img tag to a HTML page to display your image, as simple as that :-) set the width and height, add it to the page and it will be displayed. Think that you can load any HTML file and add any content you want to that HTML :-)
ryubr
NimbleKit Expert
 
Posts: 445
Joined: Fri Jun 19, 2009 5:36 am

Re: How do you insert an image ?

Postby error123 » Wed Apr 25, 2012 7:25 pm

thank you for your help. do i have to import the image into nimble kit though? like for example put it into the development folder or something? as the images are in my pictures folder on my mac
error123
 
Posts: 12
Joined: Sun Feb 19, 2012 1:01 pm

Re: How do you insert an image ?

Postby ryubr » Wed Apr 25, 2012 8:19 pm

Yes, drag it to the project and select Copy item into folder, if it is already there no problem, but you got import it to the project :-) copy files to the folder does not import then, you got drag them to the project (xCode) so they will be added to the final build.
ryubr
NimbleKit Expert
 
Posts: 445
Joined: Fri Jun 19, 2009 5:36 am

Re: How do you insert an image ?

Postby error123 » Thu Apr 26, 2012 1:27 pm

Thank you so much I got it working, one last thing now that I Have the picture inserted, I can now move the picture up and down to view it as the picture is 320x960.

but when I move the picture up and down left and right a black space appears behind the picture. is there anyway to fix the picture in place so that the user can just scroll up and down? with this finger
error123
 
Posts: 12
Joined: Sun Feb 19, 2012 1:01 pm

Re: How do you insert an image ?

Postby ryubr » Thu Apr 26, 2012 4:56 pm

It looks like you got some horizontal scroll on the page, it might be over the 320px limit. This is why you´re scrolling horizontal. If the is no scroll for the horizontal the iOS automatically prevents you to scroll left or right if there is no scroll to those places :-) Check your code ;-)
ryubr
NimbleKit Expert
 
Posts: 445
Joined: Fri Jun 19, 2009 5:36 am


Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 1 guest