Can I prevent mobile safari from auto-rotating the screen on ipod touch or iphone? - iphone

We have an offline Safari application with UI designed for vertical use (pixel perfect). We would like the UI to stay vertical no matter what how the user rotates the ipod / iphone. Is it possible with offline Safari application?
This question is exactly the same as Can I prevent mobile safari from auto-rotating the screen on ipod touch or iphone? . Yet - the referenced question has no definite answer and has been prematurely accepted.

I'm not aware of any way to prevent the rotation if it needs to run in Safari rather than a native app with an embedded UIWebView.
While you can't prevent the rotation, you can compensate for it like this:
Detect the rotation using the updateorientation event
In your event handler, find the current orientation using window.orientation. (e.g. 0, 90, -90, 180)
Update the class of your element to reflect the current orientation, and use styles like -webkit-transform:rotate(-90deg) to rotate your UI in the opposite direction.
If necessary, use window.scrollTo(0, 1); to scroll the address bar off the screen.

Related

iPhone front camera - tap to focus?

I'm trying to figure out if tap-to-focus is possible via the front facing camera device. I've seen on the iPhone4 wikipedia that it supports focus, but not much more detail. When I call isFocusPointOfInterestSupported on the front facing camera it returns NO, so...I would assume that it isn't supported. However, the apple camera app seems to have some tap support on the front facing camera - is this focus or is it adjusting exposure at the tap point?
To what capacity is focus supported on the front facing camera?
Thanks in advance for any response.
You can check on the Device Capture Settings of this page (documentation) that it doesn't support focus
https://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html#//apple_ref/doc/uid/TP40010188-CH5-SW2
and you can see it with your actual phone, even if you move it back and forth it wont change the focus unlike the back camera.

iPhone mobile Safari vs home screen link resize issue

I am trying to write a web app for Android and iPhone.
I have an issue when the device orientation changes. On the Android the orientationChanged event fires (from portrait to landscape) before the new horizontal dimensions are reported (reports portrait dimensions, with iPhone it fires AFTER (reports landscape dimensions...correct behavior).
So I fell back to the resize event. Another issue cropped up. Android works fine in browser. iPhone is works fine when the app is launched from the home screen. However in mobile safari, the resize event is never triggered when roating from landscape to portrait, since the browser just provides you the capability to scroll around the page horizontally.
I need a way to detect an orientation change event and get the new dimensions from DOM elements in order to resize other elements on the screen that will work for Android, mobile Safari and home screen web apps.
Thanks
Fell back to device detection, since there is no reliable way of doing this generically.

Website-Navigation disabled on iOS

I have a very rare problem on iOS (iphone).
i developed the site yolieva.de with a videoclip which also runs on ios. but it plays in the background because on top is the navigation with z-index. but it is not accessible from ios. kind of disabled because of the videoclip. you may want to try it with an iphone and you see you cant click through the siteā€¦
how to solve this? i want to keep the navigation above the video
I think this has something to do with how iOS deals with the videoclip, so I am not sure that you can do anything about it directly.
Why don't you make the div containing the flash player (id player) smaller on the iphone?
In fact, on the iphone your flash video is not shown in place, there is anyway a change of view, so there is no need of having it full screen either. Of course, you should make your flash player div smaller only for iOS, not other browsers, where it is fine that it is full screen...

iAds mess up my screen drawing?

I have a universal iPhone/iPad app that I'm in the process of completing. This is a music listening app that connects to and allows you to listen to music off of a user composed music site.
Since the user base for this app will be very small I've decided to put iAds in to try and get a little recovery on the programming costs.
The app is xib-less meaning that I create all components and draw every view manually. I have all of the code in place to place the iAd on screen and off screen for its various states. My app supports all rotations of all devices and my screens correctly reposition all components for every possible orientation.
After digging deep in the documentation I found that Apple always displays tapped on iAds in portrait mode. If my device is in portrait mode (upright) then there is no problem. However if I'm in landscape or upside down (yes it makes sense for this app), then the iAd displays in portrait but when closed my app is a mess.
The best way I can describe it is that each of my display items has a frame which I manually set to position it where I want it for each orientation. This works perfectly until the user taps on an iAd. The modal iAd dialog comes up then after it is closed even if I force a reposition of my components nothing draws correctly.
I've checked the view frame coordinates before and after the ad and I see some minor shifting. But what is so strange is that my components even when forced to their frame locations I desire are just a mess.
Any help would be greatly appreciated. Here is a link to the screen movie incase
embedding doesn't work: http://www.screencast.com/t/1pSwUI3EiMF

Touch events with Magic Mouse and iPhone Simulator

I observe that with the iMac magic mouse, while using the iPhone simulator, if:
a) the active view has an object in the center of the iPhone screen which is capable of generating touch events, and
b) the iMac operator accidentally or otherwise drags their finger(s) across the magic mouse surface in a way which would normally be used for scrolling, that
the object in the center generates (bogus) mouse down and drag events.
If there is no such object in the center of the screen, there is no issue.
Is there a way to programmatically or otherwise disable this feature?
This is actually an issue with all Mac input devices with scroll functionality. If you do a two-fingered scroll up and down on a Macbook touch pad the same thing happens.
I believe this is more or less "intended", though it appears the touch up event is lost - so sometimes the interface gets stuck after a scroll gesture. I don't know of a way to programmatically disable this feature, unfortunately :-/
Gesture-based scrolling the iOS simulator was disabled sometime around iOS 4 or the iPad, I believe. It would have conflicted with the giant, scrolling window of the iOS simulator running on smaller screens.