Keeping the body background image fixed on the iphone - iphone

I have been trying for days to get the background image on my JQM iPhone app to remain fixed and to have the content scroll above it.
Having research many of the answers given I have the following piece of code:
body {
background-image:url(images/background.jpg);
background-attachment:fixed;
}
Using this achieves the desired effect when previewing the app in Safari on my desktop however when I view the app on my iPhone(4s - 6.1.3) the background scrolls with the content.
I have tried many different methods to achieve what I require but so far I have not been successful. As the majority of apps use this method I am sure it is something very simple which I am missing.
Any advice would be gratefully received. Thanks.

Try to use the below one
body {
background-image:url(images/background.jpg);
background-attachment:fixed;
background-size:100%;
}

Related

Responsive website doesn't scroll smoothly on iPhone

I am having troubles with scrolling on my website on an iPhone.
What I mean by that is that normally, when you start scrolling and then release the display, the site will keep scrolling for a bit on an iPhone. But with this site, it doesn't. As soon as you remove your finger from the display, it will stop scrolling. It is as if the scrolling is sticky.
I really have no idea where I should even begin to look to debug the problem, which is why I am not posting the code (I'd have to post the complete website).
The issue is also not showing up on my Nexus 5. I have had the issue on two different iPhone 5.
I am basically looking for points to start to debug the problem right now.
Apply this script on the master page means if you have a Common layout page :
$(document).ready(function(){
var deviceAgent = navigator.userAgent.toLowerCase();
var agentID = deviceAgent.match(/(iPad|iPhone|iPod)/i);
if (agentID) {
$('body').css('-webkit-overflow-scrolling', 'touch');
}
});

iOS - How to show hints for gestures for iOS app?

I have seen some apps where when you launch them for the first time after downloading (e.g. Chrome app on iPhone), it shows you a list of animated gestures on the screen, kind of giving you a tour of the app.
How do I build one something like that? And how does the app know to launch only for the first time after download and not since then? For the second question, I am guessing a "shown=TRUE" value can be saved inside a PList file and checking the value each time when the app finished launching. But I am more curious about the mechanism involved in creating a guided app tour.
You can use transparent and semi-transparent images with a UIImageView, so you can make up an image with arrows and notes and put over the whole screen. You could fade it out when the user taps.
To know if it's the first time running the app, you should use NSUserDefaults instead of a plist; it's much easier, and you should be app to find a quick tutorial on that fairly easily.
Also, you could check around on this site for controls like this one. I haven't used any of them myself, so I'm not sure how much they differ from a regular UIImageView. They look nice though.

Zooming only an image in mobile Safari

I'm looking to see if anyone has experience with this. I'm a developer first and a designer second, so this is really not my strongest suit.
I have a project I'm working on where the goal is to get image and text side-by-side in landscape mode on the iPhone. I'd like to be able to zoom in on the image using a pinch like normal, but not zoom in on the text as well while that is happening. I don't know if this is even possible or what kind of hacks it would take to get it working.
If someone thinks this is bad in general from a UI perspective, I am open to suggestions.
I have considered keeping two copies of the image (low and high res) and then swapping them out inside of div with an overflow: scroll; so users can get a zoomed version and then scroll around. It doesn't give you the full effect of zooming, but it might accomplish a similar goal. I don't know if this would work either.
If anyone has suggestions or experience on the subject, please chime in. Thank you!
To do this in mobile safari you would probably have to use javascript. Theres a jQuery plugin here: http://plugins.jquery.com/project/pinch
Might be of some help
If you want to use Mobile Safari, then you will need a touch framework like jTouch to simplify things.
Natively, you should put your image and text inside a UIScrollView, and return the image view in the the viewForZoomingInScrollView: (in the scroll view's delegates) to the image view.
Is that what you want?

Best way to display web content on my iPhone app (if possible without using UIWebView)

I want to build an iPhone app that should , among other things, display the some content of a website's detail pages. This content includes a)a title b) an image c) a text passage (with multiple paragraphs.
I have done a brief research and found out that the easiest way to do this is by using uiwebview. The problem is that in that scenario I would have to be constantly in touch with the person responsible for the website in order to create a modified html/css version for the iPhone client.
As a result I was wondering if there is a feasible alternative. I can get the data I want in json format with HTML Requests. Maybe if I used a UIScrollView that contains a UILabel for the title, a UIImage for the image and another UILabel for the text passage? But the problem is how to set the UIscrollview content size since it dependent on the size of the text passage?
I am a iPhone dev noob and I am possibly missing something obvious here so I would be very greatful if someone could point me in the right direction.
Sounds like you are building an app ontop of somebody elses content. Provided this is legal, this other site should have a published api where you can start to write your app. Get the json or xml, then populate them in a UIViewController using a UIImageView to display the image, UITextView for the text. The UITextView already has a built in scroller so you dont need a UIScrollView

How do you implement swipe-able image stacks like the Photo app using the iPhone SDK?

I would like to take a stack of images (or potentially an array of URLs to download images) and display them in full screen, one at a time, using user swipes to smoothly animate the next image in the stack, using the iPhone SDK. Apple's Photo.app seems to do this. Additionally, if the image has not been retrieved yet, I'd like to display the progress indicator.
Can you point me to example code and explain how this technique would be implemented?
You need to use UIScrollview's page control mechanism. Apple has plenty of sample code, including one called, strangely enough, Page Control:
http://developer.apple.com/iphone/library/samplecode/PageControl/index.html
If you want any behavior beyond that, you'll have to roll it yourself.