cocoa-touch

How to animate layer shadowOpacity?

半城伤御伤魂 提交于 2019-12-31 08:24:30
问题 I have a view on which I've set the layerOpacity to 1. theView.layer.shadowOpacity = 1.0; This looks fine when the view is farther down the screen. When I move this view up to be flush with another view that has a shadow, they don't look good. Is there a way I can animate the shadowOpacity on my layer to be 0? I tried using an animation block but it seems as if this property is not animatable. EDIT: Request for code that doesn't work: [UIView animateWithDuration:1.0 animations:^{ splitView2

How do I call performSelectorOnMainThread: with an selector that takes > 1 arguments?

烈酒焚心 提交于 2019-12-31 08:13:08
问题 A typical call to performSelectorOnMainThread: looks like this: [target performSelectorOnMainThread:action withObject:foo waitUntilDone:NO]; where "result" is an argument passed to "action". A corresponding action would be: - (void)doSomethingWithThing1:(id *)thing1 What is the correct syntax for calling an action that takes > 1 argument? Such as: - (void)doSomethingWithThing1:(id *)thing1 andThing2(id *)thing2 andAlsoThing3(id *)thing3 [target performSelectorOnMainThread:action withObject:??

What exactly does bool parameter do in animateWithDuration:animations:completion:

こ雲淡風輕ζ 提交于 2019-12-31 08:10:08
问题 I referred to the DOC and it said: completion ... This block has no return value and takes a single Boolean argument that indicates whether or not the animations actually finished before the completion handler was called. ... But I find that no matter you use the bool parameter or not, the completion: block will always execute after animations: block. Just like the two simple block-based animation code snippets shown below, both of them are doing the same. [UIView animateWithDuration:0.3f

UIModalPresentationFullScreen not working in iPad landscape mode?

懵懂的女人 提交于 2019-12-31 07:08:42
问题 I have added a ViewvController(B) as subview on ViewController(A). In ViewController A(SuperView) UIModelPresentationFullScreen working fine. But when am calling UIModelPresentationFull in ViewController B(SubView) it modelview showing in Portrait mode and that is also not fully viewed. How to solve this problem. Can any one help me please. I have tried 2 days. This is what I tried in both the superview and subview... picFBCapture *fbCapt = [[picFBCapture alloc] init]; //[self

UIModalPresentationFullScreen not working in iPad landscape mode?

夙愿已清 提交于 2019-12-31 07:08:31
问题 I have added a ViewvController(B) as subview on ViewController(A). In ViewController A(SuperView) UIModelPresentationFullScreen working fine. But when am calling UIModelPresentationFull in ViewController B(SubView) it modelview showing in Portrait mode and that is also not fully viewed. How to solve this problem. Can any one help me please. I have tried 2 days. This is what I tried in both the superview and subview... picFBCapture *fbCapt = [[picFBCapture alloc] init]; //[self

How to autorotate from portrait to landscape mode?

感情迁移 提交于 2019-12-31 06:57:52
问题 How can I autorotate an image from portrait to landscape mode on the IPhone? 回答1: If you want to display a new and different view, the simplest and cleanest solution is to push a new view controller (presentModalViewController) that only supports landscape mode (in shouldAutorotateToInterfaceOrientation:). 回答2: You have to implement shouldAutorotateToInterfaceOrientation method in your controller, like this - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation

UITextView member variable is always nil in my UIViewController

冷暖自知 提交于 2019-12-31 05:42:12
问题 In my nib, I have a UITextView component. In my UIViewController I have a UITextView member field and I have used IB to make sure that the two are connected (at least I think I did that by dragging from "Files Owner" and dropping it on the UITextView in IB and selecting my member variable). Now, when I update the text via setText: , the UITextView still remains blank. When I break into my code, the member variable (called textView ) is nil . So I am guessing I have not used IB correctly. How

Sorting an NSArray by a key-value relationship that is 2 levels deep

偶尔善良 提交于 2019-12-31 05:33:07
问题 I have an NSArray of UILocalNotification objects that I need to sort according to a key within the UILocalNotification's userInfo property, which is an NSDictionary. I know how to sort NSArrays by a value that is one level deep, e.g., a key within an array of NSDictionaries, but two levels deep I'm lost. I want to do something like this is psuedo-code: NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"userInfo.personName" ascending:YES]; //the personName key within

Change UIDocumentInteractionController Icons

旧巷老猫 提交于 2019-12-31 05:25:14
问题 I was wondering how I can change the icons that show up in the table view. I looked at the documentation for UIDocumentInteractionController on apple.com but I didn't have any success editing my plist. If someone knows how to do this please help. Thank you 回答1: Registering the File Types Your App Supports describes how to register custom file types together with their icons in an app. So if you use "com.example.myformat" as UTI type in the LSItemContentTypes array of the plist, and set the