CSS Transform Rotated Images Not Showing in Safari - ios

I'm noticing on iPhone that the images for the "subscribe" widget and the "Spark" widget are not displaying the images inside of them. The images are using CSS Transforms to rotate them. I'm unable to pinpoint what the issue is, any guidance at all would be amazing!

It has nothing to do with iPhone, the height of the image is set to 0px and not changed for smaller widths. You will get the same effect if you reload the page on any browser while on a small window width.

Related

What would be a good pattern to display a photo gallery from the web on an iOS app?

I need to display a series of banner images from the web inside an iOS app. Pretty much like this:
I'll get the list of images to be displayed from an API call.
My struggles started when I started considering what should happen when the user rotate the phone. Given the constraints, the image will expand, keeping aspect ratio and leading and trailing distance of 15 from the superview.
Given that screen resolutions are very diverse, what should be width of the images saved on the server? Rotating the phone doesn't change screen scale, right?
But the available width changes. So, should I send the width available so the server can either generate or return the appropriate image? But then, I need to find a way to get notified when the screen rotates and reload the appropriate image, right?
Is that the right way to go? Or maybe webview would be the best option here (even though I'm gonna need to handle click events for those images)?

iOS Launch Screen Image not always showing

I use a Launch Screen (xib) in my app to overcome the problem of the resizeable screen, since i don't always want add Launchscreens everytime, Apple create a new iPhone with a different screen resolution.
In my launchscreen, i placed a UIImageView directly in the center of the view using constraints. The image shows the logo of the company i work for.
The problem is, that sometimes the image is being hidden (mostly after install and first launch) and sometimes it shows (mostly after a view times using it). I'm not quite sure, what the problem is. Is it because at the first-launch-time(s) it has to load many ressources?
Figured out the problem: It seems, that if there isn't enough disc space left on the device, it doesn't show the xib's (Launch-Screen's) Image. iOS at some point clears out some disc-space (i guess from NSLibraryDirectory) and than the images show again.
If this is a major problem to any of your apps, use Launch-Images instead.

How do I make the black bars on the side of an HTML5 Video on iPad disappear?

I'm working on a WebApp that is supposed to run mostly on iPads. The App plays several videos and has some interactive components as well.
My problem is cosmetic: even though the HTML5 Video Tag works fine, the custom controls that I've created control the video/audio playback just fine, for the life of me I can't figure out how to make the black bars on the side of the video disappear.
The embedding is completely standard:
<video id="video" src="./video/video.mp4" width="1024"></video>
I just want the damn video to be exactly as wide as the iPad screen, but no matter what size I specify, there are always black bars on the side. The only workaround i found is to oversize the video and then give it a negative margin so it'd center, but surely there must be a better solution... Especially because the width of the black unwanted "margin" isn't constant and changes according to the specified width of the video. Has anyone had the same problem before? Any idea or help will be greatly appreciated. Thank you all.
Thanks for the input. It turned out that I had to specify the height for the video element as well, for some reason Safari on the iPad doesn't scale the video and the controls properly; as soon as I explicitly specified the pixel equivalent of 16:9 within the actual video tag,
in the HTML file, the bar disappeared.

Flickering issue with VirtualSurfaceImageSource

I'm considering using VirtualSurfaceImageSource in my application, and I've implemented something similar to the Direct2D magazine app sample, but I've run into a problem which occurs when the virtual surface is several times larger than the display area.
Basically, I have a horizontally scrolling ScrollViewer which contains an Image. The source of the image is a wide VirtualSurfaceImageSource (at least ~10000 x 500 px). The width of the ScrollViewer is 1280 px.
When I scroll the scroll viewer with touch panning, the image sometimes flicker - a part of the image disappears and then it's redrawn. This usually happens when the inertial scrolling stops. The image is already fully drawn when it scrolls into the view, but for some reason it's cleared and IVirtualSurfaceUpdatesCallbackNative::UpdatesNeeded() is called.
I've uploaded a video which illustrates the problem. Watch what happens when the scrolling stops (at 0:02, 0:17, etc...)
Any ideas why this is happening?
I've also noticed that the flickering doesn't occur if the image width is ~5000 px or less.
If you want to reproduce this, start from the Direct2D magazine app sample and add more text in the Sample.story, under the <text name="butterfly-body"> tag - just copy the existing text 10 times or so. Try scrolling the butterfly page in both directions and with varying speed, and you should see what appears to be the same problem.
I've asked this question in an MSDN forum, but so far I've gotten no answer.
This is no longer an issue in Windows 8 Release Preview, so it was probably just a bug in the Consumer Preview.

UIWebView - Limiting Content Width

I've come across an interesting problem with UIWebView.
I basically want to use a UiWebView on an iPad app as a modal pop-up to show wikipedia or amazon mobile pages if the user performs certain actions.
I have the code to create and load the UIWebView working fine, but the content loaded pays no attention to the width of the UIWebView. I wanted the UIWebView to (roughly) be the width of an iPhone screen and have set the frame accordingly.
However, when the content loads it appears that it loads at the width and height of an iPad screen so it scrolls both horizontally and vertically. Vertical scrolling is fine but horizontal is not.
When the same URLs are loaded on the iPhone (just in safari), the content resizes to fit the width of the device, which I assume is using a meta-tag?
The question is, how I can replicate this behaviour in a UIWebView on the iPad and "force" the content down to a set width.
Update
Apologies, this is a duplicate of the question answered at UIWebView -- load external website, programmatically set initial zoom scale, and allow user to zoom afterwards
This solution is smart and works.
The size of the content will depend on a mix of the size of the browser's viewport, as well as the HTML / CSS that is implemented on the site.
As you are saying the site scales correctly in Safari, Check the frame of the webView is correct in your app. Sometimes the site may have implemented aspect ratio comparisons to work out which responsive view to show, so experiment also with the height of the modal to match the size of an iPhone.
Another thing you can try is setting constraints on the webView. I've found setting constraints will also sometimes alter the viewport size & rendering.
If that doesn't work - You could also try scaling the content. The answer here will help: HTML Content fit in UIWebview without zooming out

Resources