I have implemented a scrollview which uses a CATiledLayer. In UIDocumentInteractionController the view shows some kind of checkerboard background while loading its contents. I wonder if there is something similar to UIColor.ScrollViewTexturedBackgroundColor to get this checkerboard? Or do I have to use my own image?
No, there's none in the IOS documentation, unfortunately. Apple uses their custom backgrounds on a lot of apps, and in general you just need to create it and load it with the UIColor.FromPatternImage(UIImage.FromBundle("image")) command.
Related
I have read dozens of questions about mimicking iOS 7 blur effect in earlier versions of iOS. But the fundamental question that arises here is does iOS 7's UIKit really have a nice and convenient way to make any UIView blurred? That seems quite logical to me. Any help appreciated.
Apple has provided sample code to blur any UIImage in iOS 7's style.
Go to Apple Developer downloads and log in if necessary. Search for "imageeffects" to bring up the WWDC 2013 Sample Code entry, and download the iOS_UIImageEffects sample code.
In that project, there's a UIImage category in UIImage+ImageEffects.h that you can copy into your own project, containing the applyBlurWithRadius:... method.
You'll need to link your project with the Accelerate framework.
This won't automatically do a blur on a view in realtime — for that, see FXBlurView, which performs a similar technique by automatically snapshotting its superview. It can be pretty performance-intensive, though: consider first whether you can achieve what you want by statically blurring an image, rather than trying to "live"-blur moving content.
UPDATE
As of iOS 8.0 (not iOS 7), UIKit provides UIVisualEffectView and UIBlurEffect. You can watch WWDC 2014 Session 419 “Advanced Graphics and Animations for iOS Apps” (or just download the slides) for an introduction to these classes.
ORIGINAL
No, it doesn't. Apple has not exposed an interface for doing this conveniently. For example, if you read through this discussion, Rincewind's responses should make it clear that Apple doesn't provide a public API for this, and that the private APIs they use have serious limits and are likely to change.
You must implement the blur effect yourself. You'll probably want to use the new -[UIView drawViewHierarchyInRect:afterScreenUpdates:] method to capture the appearance of the background view, and then apply a CIFilter to it to perform the blur.
UIKit does not have a convenient way of achieving this effect. However, there's a few libraries on Github that easily achieve this effect. Nick Lockwood's seems to be the most popular.
I've created many types of interfaces using the Cocoa API — some of them using documented basic animation techniques and others simply by experimenting (such as placing an animated .gif inside an NSImage class) — which had somewhat catastrophic consequences. The question I have is what is the correct or the most effective way to create an animated and dynamic GUI so that it runs optimally and properly?
The closest example I can think of that would use a similar type of animation would be something one might see done in flash on any number of interactive websites or interfaces. I'm sure flash can be used in a Cocoa app, although if there is a way to achieve a similar result without re-inventing the wheel, or having to use 3rd party SDKs, I would love to get some input. Keep in mind I'm not just thinking of animation for games, iOS, etc. — I'm most interested in an animated GUI for Mac OS X, and making it 'flow' as one might interact in it.
If u wish to add many graphics animations, then go for OpenGLES based xcode project for iOS. That helps u to reduce performance problem. You can render each of the frames in gif as 2D texture.
I would recommend that you take a look at Core Animation. It is Apples framework for hardware accelerated animations for both OS X and iOS. It's built for making animated GUIs.
You can animate the property changes for things like position, opacity, color, transforms etc and also animate gradients with CAGradientLayer and animate non-rectagunal shapes using CAShapeLayer and a lot of other things.
A good resource to get you started is the Core Animation Programming Guide.
I'm wondering if it's possible to have a slide with text AND add some animation into it for an iPad app. See screenshot below to get an idea of what I need. I want that guy jump up and down and smile. I'm sure I'm not capable of drawing that image using Objective-C primitives myself, so I'm looking at the following options:
Do complete animation in 3rd-party tool (Adobe?) and then add it as single standalone file on the slide. But I do not know, what formats are supported in iOS, what are standard formats, and, at the end, how to insert that file on the slide. Can somebody clarify this please?
Do complete animation, and then save frames as images, and then quickly change images to give illusion of a movie.
Am I missing something? Are there any other ways? what's the best option?
Please let me know if I'm not clear enough - I will try to provide more information.
Thank you.
If you want to use a movie file for the animation, you can find the supported video formats in the iOS Technology Overview, under “Media Layer > Video Technologies”. You will need to use an AVPlayerLayer from the AVFoundation Framework to show the video.
If you want to use a separate image file for each frame, you can use one of the +[UIImage animatedImage...] methods to create an animated UIImage, and display it in a UIImageView.
If you want to use a single animated GIF for the animation, you can use this public domain UIImage+animatedGIF category to load the GIF into an animated UIImage, and display it in a UIImageView.
I have implemented crop functionality but
Is it possible to selection crop image like below link
http://deepliquid.com/projects/Jcrop/demos.php?demo=advanced
Short answer, not really unless you do some clever coding and view aligning / transforming.
Long answer, you have two options:
Create your own custom module with XCode, OBJ-C etc.
Just nest the Jcrop code in your own webview inside titanium. (This seems easiest).
I am using UIImagePickerController for selecting images from the photo library. But I am getting a message on the console saying "Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations."
What is this due to ?
Thanks
Several people appear to be having the same problem. None of these links provide a solution (as far as I can tell), so this post is intended just as a starting point for more searching. I have made it CW.
stackoverflow: Single-Stage vs Two-Stage Animation for iPhone Apps
cocoabuilder: how to change to the smoother single stage animation
stackoverflow: tabbarcontroller and navigationcontrollers in landscape mode
Apple support: 11186784
That normally means you have implemented one of:
willAnimateFirstHalfOfRotationToInterfaceOrientation:duration:
willAnimateSecondHalfOfRotationFromInterfaceOrientation:duration:
on one of your view controllers, even if they are empty. This is neither wrong nor deprecated, the message just say it could possibly done better if you moved your implementation to: willAnimateRotationToInterfaceOrientation:duration: