IOS Orientation fix doesn't work all the time - ios

I am developping a swipe gallery for mobile devices. Users can change images by sliding the screen, as any normal images gallery in most iPhone app.
Here is a demo:
http://daviddarx.com/stuffs/work/custom/swip/
To debug the iOS orientation bug (which let the content zoomed when you change the orientation), I used the only library that correct that:
http://scottjehl.github.com/iOS-Orientationchange-Fix/
Unfortunately, this library is working perfectly most of the time, but it happens to fail and not work correctly. This happen around 1 time on 10 times, and the result is then the same as if the library wasn't here.
This is not a huge problem on most of the mobile and responsive website, as the user can manually dezoom and then get back to the normal display.
But the problem here is that I had to disable the zoom function, to make my system work correctly. So, when the bug happen, once on 10 times, the gallery is then just bugged and stay like that....
So, here are my questions:
-do you know any other library that manage that bug fix, and is 100% completely reliable?
-if not, do you know a way to correct the used library to get a 100% support rate?
-if not, do you have any idea or solution for me?
Thank you in advance for your help!
David

There's an outstanding pull request on Scott Jehl's repo that uses slope detection instead of absolute values which seems to not suffer from the intermittent-ness of the original solution.
https://github.com/PeterWooster/iOS-Orientationchange-Fix/

Related

iOS Resizable GUIs with JUCE

I'm using the JUCE framework to make my first few iOS apps, mostly just proofs of concepts for my Github account for job recruiters.
I've got my first app compiled and working on iOS, but I'm having tons of issues with the GUI.
I can't seem to find the right resolutions to fill the screen. I'm testing with an iPhone 7 Plus, and I figured I could just type in the resolution of that screen to the Projucer, but it doesn't work correctly.
Then I realize I'd probably just want one that fills the screen automatically, but dont know which function calls to use or where its located in the Projucer (haven't found it yet).
Also, I'm entirely new to GUI developing as of December, so I'm still learning all of this. I would greatly appreciate keeping it simple. Thank you to anyone who is able to help.
Try this in MainComponent.cpp
Rectangle<int> area = Desktop::getInstance().getDisplays().getMainDisplay().totalArea;
centreWithSize (area.getWidth(), area.getHeight());

Scrolling issue with fixed divs in iframe on IOS

I am having a problem with iOS scrolling on an iPad. Every other platform tested works just fine. I love iOS, but hate it too. I was able to get the entire iframe contents scrolling within the parent, but there are two DIVs that are fixed that shouldn’t scroll within the iframe.
Before I spend a lot of time trying to work this out, I am just looking to leverage everyone’s experience for whether it, in fact, CAN be done. If it IS possible, then I will proceed to trying to work out a simple model and report it back for others. If experience shows that it can NOT be done, then you will all have saved me a lot of headache, not to mention time.
Here’s a drawing of what works on all other platforms but NOT iOS:
Simple question: Is it possible?
The simple answer is, in fact, YES.

Simple Javascript Sprite Animation - line flicker, but only on iOS devices

There is a problem with the sprite animation on the homepage of one of my clients, but it only appears when the site is viewed on an iOS device, namely an iPhone or iPad. I can't replicate the problem on any other device or emulator, so I'm having an issue troubleshooting it (don't own an iPhone or iPad). The problem is: what looks to be a 1px line is appearing on the right edge of the animation frame pretty much all the time, and a similar line flickers occasionally at the top of the frame as the animation runs. The animation itself is a simple javascript sprite sheet animation. I'm operating under the assumption that I have the sprite animation programmed correctly since it appears correctly on every other device, platform and browser I've checked. It even works in IE.
Two questions:
What would cause a simple sprite animation to display differently when rendered by iOS?
As a small business consultant, I don't have the time and my clients don't have the budget for me to physically test on every single device, so I have to rely on emulators. What other options do I have if the emulators don't properly demonstrate what the device will display?
I'm not entirely sure of the protocol regarding posting a link to my client's production website, but happy to send a link to anyone willing to help that responds and/or messages me.
welcome to SO.
I spend a lot of time working specifically with iOS on the web and have run into similar situations. Without tweaking an example you post I won't be able to prove it exactly, but this should at least give you direction.
Flickering or semi opaque lines are often caused by the scaling set to the asset. In the world of high DPI displays and fluid layouts, there are differences in rounding that result in fine lines, shimmers, et al. Is there any scaling set on the assets, e.g. background-size, downsampling?
The emulators are displaying the software correctly - these issues are a result of hardware. Best thing you can do is buy a flagship for all of the platforms you test on, or look into local resources like Clearleft's Device Testing Lab

iPad Limitations on Canvas Tag; Webpage Crashses on Canvas Tag Animation

Does anyone know if the iPad has any limitations on the canvas tag?
Currently I'm working on a creative that uses a flipbook and audio tag combination to simulate inline video content. The animations are drawn to the canvas element and synced with the audio content being played. There are 4 short video clips that get played when someone clicks on the four buttons below.
http://cs.sandbox.millennialmedia.com/~tkirchner/rich/K/kungfupanda2_test/
The problem I'm having though is in iPad. After playing a few animations, mobile safari just suddenly crashes. It never happens when I play it on my iPhone but it happens every time on the iPad. Its not one particular animation either because if I click a different combination of buttons, the previous clip that it crashed on plays fine, and then it decides to crash on another clip.
I think the problem might have to do with the amount of memory Safari gives individual page views. I found a blog post that explains that problem pretty well.
http://roblaplaca.com/blog/2010/05/05/ipad-safari-image-limit-workaround/
According to that post, once mobile Safari reaches a particular threshold of memory, images begin to return blank. This is consistant with my finds so far. The iPad that I'm testing this all on is running iOS 3.2.1 (and before anyone tells me that I should just explain to my boss that nobody uses 3.X anymore, I tried... they still want me to investigate this). I borrowed a co-workers iPad running iOS 4.2.1 and that device didn't crash, but some of the images weren't being drawn to the canvas.
I'm pretty sure its a problem with the canvas tag too, because I tried experimenting with running the animation without drawing anything to the canvas element, and the page never crashed.
Thats why I think maybe its a limitation with Safari's support of the canvas tag. Of course, I'm open to anybody else's suggestions.
Feels kinda weird answering my own question again, buuuut I figured if anyone did a search on this kind of question, an answer would be helpful.
I believe my original hypothesis was correct. The total amount of images that the aniamtions were using was around 600+. I think the older iPad loaded as many as it could and then when it ran out of cache and the canvas tag was trying to draw images that weren't really there anymore, it crashed.
Eventually we ended up serving the ad to devices with iOS 4.2 and higher, since the problem didn't seem to occur on those newer devices. Plus, we compressed the image sizes further, so that helped reduce the amount of images we were storing into memory.
If anybody knows approximately what the cache threshold in iOS 4.2 or higher browsers are, I'd appreciate it if you commented. Just want to get an idea of how many KB of image data I can safely load.

Preventing screen grab within Delphi [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How can I prevent users from taking screenshots of my application window?
So far I have be able to stop the Prt Sc key press and able to clear the clipboard so that my application cannot be screen grab.
However as a test I tried used Corel PaintShop pro and an option it has is to import screen capture which is very different from screen grabbing using the clipboard and as I suspected my application did not stop this.
So I have found the following code at this site : http://www.bitwisemag.com/copy/delphi/delphi1.html
This uses a different way of grabbing what is on screen and I presume that Corels method is similar to this. Is there anyway of this method of screen grabbing from being used on my application.
Greg Hewgill - Cheers for this - I will read this post
to get a screenshot on Windows is trivial, eg GetWindowDC(NULL). The only way I can think of is similar to this answer: stackoverflow.com/questions/455623/… – Nick
Nick looks like the same post that Greg has mentioned - however cheers for your response
Why go to this trouble? People nowadays can simply take a photo with their phone and send that around? – Marjan Venema
That may be true Marjan but I am trying to stop spyware programs from click logging if that makes the matter clearer.
The only way I can think of is to use DirectX. When certain apps such as DVD players write to the screen using DirectX, Windows sees a black (not quite black, but close) rectangle where the video shows. Attemps to use PrintScr or GetWindowDC() return that black rectangle. High-end screen capture apps like Snag-It can use DirectX to render the image properly, but this would be a 99% solution for you, and as others have said, users can always take a photo anyway.

Resources