¡@

Home 

2014/10/15 ¤U¤È 10:04:51

iphone Programming Glossary: calayer

Disabling implicit animations in -[CALayer setNeedsDisplayInRect:]

http://stackoverflow.com/questions/2244147/disabling-implicit-animations-in-calayer-setneedsdisplayinrect

implicit animations in CALayer setNeedsDisplayInRect I've got a layer with some complex drawing code in its drawInContext method...

Rounded UIView using CALayers - only some corners - How?

http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how

UIView using CALayers only some corners How In my application there are four buttons named as follows. Top left Bottom left.. UIImage imageWithData NSData dataWithContentsOfURL NSURL URLWithString @ any Url Here CALayer l imgVUserImg layer l setMasksToBounds YES l setCornerRadius 5.0 l setBorderWidth 2.0 l setBorderColor..

How to resize a UIPresentationFormSheet?

http://stackoverflow.com/questions/2457947/how-to-resize-a-uipresentationformsheet

How do I apply a perspective transform to a UIView?

http://stackoverflow.com/questions/347721/how-do-i-apply-a-perspective-transform-to-a-uiview

a UIView such as seen in coverflow Does anyonew know if this is possible I've investigated using CALayer and have run through all the pragmatic programmer Core Animation podcasts but I'm still no clearer on.. to that. You should also be able to do the following UIView myView self subviews objectAtIndex 0 CALayer layer myView.layer CATransform3D rotationAndPerspectiveTransform CATransform3DIdentity rotationAndPerspectiveTransform.m34.. with code can be found here where I've implemented touch based rotation and scaling on a couple of CALayers based on an example by Bill Dudney. The newest version of the program at the very bottom of the page..

Bold & Non-Bold Text In A Single UILabel?

http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel

than 2 UILabels. iOS 3.2 and above Example. Don't forget to add QuartzCore framework needed for CALayers and CoreText needed for the attributed string. #import QuartzCore QuartzCore.h #import CoreText CoreText.h.. an NSAttributedString _textLayer.backgroundColor UIColor clearColor .CGColor _textLayer.wrapped NO CALayer layer self.navigationController.toolbar.layer self is a view controller contained by a navigation controller..

Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints?

http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints

and functionality that you would expect from a good PDF viewer. You can draw a PDF page to a CALayer or to a UIImage . Apple even have sample code to show how draw a large PDF in a Zoomable UIScrollview.. zoom levels. CATiledLayer Method Theres a significant Overhead time drawing a full PDF page to a CALayer individual tiles can be seen rendering even with a tileSize tweak CALayers cant be prepared ahead of.. a full PDF page to a CALayer individual tiles can be seen rendering even with a tileSize tweak CALayers cant be prepared ahead of time rendered off screen . Generally PDF viewers are pretty heavy on memory..

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

shadow effect on UIView layer I have the following CALayer CAGradientLayer gradient CAGradientLayer layer gradient.frame CGRectMake 8 57 296 30 gradient.cornerRadius..

How do I reset after a UIScrollView zoom?

http://stackoverflow.com/questions/448285/how-do-i-reset-after-a-uiscrollview-zoom

after zooming and how do I have a smooth zoom throughout Edit New findings The error seems to be CALayer retainCount message sent to deallocated instance I'm never deallocating any layers myself. Before I..

Round two corners in UIView

http://stackoverflow.com/questions/4847163/round-two-corners-in-uiview

share improve this question as far as I know if you also need to mask the subviews you could use CALayer masking. There are 2 ways to do this. The first one is a bit more elegant the second one is a workaround.. one is a bit more elegant the second one is a workaround but it's also fast. Both are based on CALayer masking. I've used both methods in a couple of projects last year then I hope you can find something.. self.view.bounds 50.0 50.0 0.0 0.0 Create a new layer that will work as a mask CALayer layerMask CALayer layer layerMask.frame self.view.bounds Put the mask image as content of the layer..

Disabling implicit animations in -[CALayer setNeedsDisplayInRect:]

http://stackoverflow.com/questions/2244147/disabling-implicit-animations-in-calayer-setneedsdisplayinrect

implicit animations in CALayer setNeedsDisplayInRect I've got a layer with some complex drawing code in its drawInContext method. I'm trying to minimize the amount of drawing I need to do so..

Rounded UIView using CALayers - only some corners - How?

http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how

UIView using CALayers only some corners How In my application there are four buttons named as follows. Top left Bottom left Top right Bottom right Above this buttons there is an image.. view. Here it is. imgVUserImg is a image view on IB. imgVUserImg.image UIImage imageWithData NSData dataWithContentsOfURL NSURL URLWithString @ any Url Here CALayer l imgVUserImg layer l setMasksToBounds YES l setCornerRadius 5.0 l setBorderWidth 2.0 l setBorderColor UIColor darkGrayColor CGColor Above code is applying the..

How to resize a UIPresentationFormSheet?

http://stackoverflow.com/questions/2457947/how-to-resize-a-uipresentationformsheet

How do I apply a perspective transform to a UIView?

http://stackoverflow.com/questions/347721/how-do-i-apply-a-perspective-transform-to-a-uiview

a UIView I'm looking to perform a perspective transform on a UIView such as seen in coverflow Does anyonew know if this is possible I've investigated using CALayer and have run through all the pragmatic programmer Core Animation podcasts but I'm still no clearer on how to create this kind of transform on an iPhone. Any help.. initial transform then apply your layer rotation transforms to that. You should also be able to do the following UIView myView self subviews objectAtIndex 0 CALayer layer myView.layer CATransform3D rotationAndPerspectiveTransform CATransform3DIdentity rotationAndPerspectiveTransform.m34 1.0 500 rotationAndPerspectiveTransform.. from scratch for each rotation. A full example of this with code can be found here where I've implemented touch based rotation and scaling on a couple of CALayers based on an example by Bill Dudney. The newest version of the program at the very bottom of the page implements this kind of perspective operation. The code should..

Bold & Non-Bold Text In A Single UILabel?

http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel

with an NSAttributedString much lighter and simpler than 2 UILabels. iOS 3.2 and above Example. Don't forget to add QuartzCore framework needed for CALayers and CoreText needed for the attributed string. #import QuartzCore QuartzCore.h #import CoreText CoreText.h Below example will add a sublayer to the toolbar of.. 13 .fontName not needed since `string` property will be an NSAttributedString _textLayer.backgroundColor UIColor clearColor .CGColor _textLayer.wrapped NO CALayer layer self.navigationController.toolbar.layer self is a view controller contained by a navigation controller _textLayer.frame CGRectMake layer.bounds.size.width..

Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints?

http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints

very easily with a UIWebView but this cant give the performance and functionality that you would expect from a good PDF viewer. You can draw a PDF page to a CALayer or to a UIImage . Apple even have sample code to show how draw a large PDF in a Zoomable UIScrollview But the same issues keep cropping up. UIImage Method PDF's.. limits prevents using it to create a real time render of new zoom levels. CATiledLayer Method Theres a significant Overhead time drawing a full PDF page to a CALayer individual tiles can be seen rendering even with a tileSize tweak CALayers cant be prepared ahead of time rendered off screen . Generally PDF viewers are pretty.. CATiledLayer Method Theres a significant Overhead time drawing a full PDF page to a CALayer individual tiles can be seen rendering even with a tileSize tweak CALayers cant be prepared ahead of time rendered off screen . Generally PDF viewers are pretty heavy on memory too. Even monitor the memory usage of apple's zoomable PDF..

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

shadow effect on UIView layer I have the following CALayer CAGradientLayer gradient CAGradientLayer layer gradient.frame CGRectMake 8 57 296 30 gradient.cornerRadius 3.0f gradient.colors NSArray arrayWithObjects id RGB..

How do I reset after a UIScrollView zoom?

http://stackoverflow.com/questions/448285/how-do-i-reset-after-a-uiscrollview-zoom

allow the graph to redraw itself at the standard scale of 1x1 after zooming and how do I have a smooth zoom throughout Edit New findings The error seems to be CALayer retainCount message sent to deallocated instance I'm never deallocating any layers myself. Before I wasn't even deleting any views or anything. This error was being..

Round two corners in UIView

http://stackoverflow.com/questions/4847163/round-two-corners-in-uiview

view. Any ideas why iphone objective c rounded corners share improve this question as far as I know if you also need to mask the subviews you could use CALayer masking. There are 2 ways to do this. The first one is a bit more elegant the second one is a workaround but it's also fast. Both are based on CALayer masking... use CALayer masking. There are 2 ways to do this. The first one is a bit more elegant the second one is a workaround but it's also fast. Both are based on CALayer masking. I've used both methods in a couple of projects last year then I hope you can find something useful. Solution 1 First of all I created this function to.. you need calling the previous function UIImage mask MTDContextCreateRoundedMask self.view.bounds 50.0 50.0 0.0 0.0 Create a new layer that will work as a mask CALayer layerMask CALayer layer layerMask.frame self.view.bounds Put the mask image as content of the layer layerMask.contents id mask.CGImage set the mask layer as mask..

Disabling implicit animations in -[CALayer setNeedsDisplayInRect:]

http://stackoverflow.com/questions/2244147/disabling-implicit-animations-in-calayer-setneedsdisplayinrect

implicit animations in CALayer setNeedsDisplayInRect I've got a layer with some complex drawing code in its drawInContext method. I'm trying to minimize..

Rounded UIView using CALayers - only some corners - How?

http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how

UIView using CALayers only some corners How In my application there are four buttons named as follows. Top left Bottom left Top right Bottom.. view on IB. imgVUserImg.image UIImage imageWithData NSData dataWithContentsOfURL NSURL URLWithString @ any Url Here CALayer l imgVUserImg layer l setMasksToBounds YES l setCornerRadius 5.0 l setBorderWidth 2.0 l setBorderColor UIColor darkGrayColor..

Animating a custom property of CALayer subclass

http://stackoverflow.com/questions/2395382/animating-a-custom-property-of-calayer-subclass

a custom property of CALayer subclass I have a CALayer subclass MyLayer that has a NSInteger property called myInt. I'd really like to animate this.. a custom property of CALayer subclass I have a CALayer subclass MyLayer that has a NSInteger property called myInt. I'd really like to animate this property via CABasicAnimation..

How to resize a UIPresentationFormSheet?

http://stackoverflow.com/questions/2457947/how-to-resize-a-uipresentationformsheet

How do I apply a perspective transform to a UIView?

http://stackoverflow.com/questions/347721/how-do-i-apply-a-perspective-transform-to-a-uiview

transform on a UIView such as seen in coverflow Does anyonew know if this is possible I've investigated using CALayer and have run through all the pragmatic programmer Core Animation podcasts but I'm still no clearer on how to create this.. rotation transforms to that. You should also be able to do the following UIView myView self subviews objectAtIndex 0 CALayer layer myView.layer CATransform3D rotationAndPerspectiveTransform CATransform3DIdentity rotationAndPerspectiveTransform.m34.. example of this with code can be found here where I've implemented touch based rotation and scaling on a couple of CALayers based on an example by Bill Dudney. The newest version of the program at the very bottom of the page implements this kind..

Bold & Non-Bold Text In A Single UILabel?

http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel

lighter and simpler than 2 UILabels. iOS 3.2 and above Example. Don't forget to add QuartzCore framework needed for CALayers and CoreText needed for the attributed string. #import QuartzCore QuartzCore.h #import CoreText CoreText.h Below example.. property will be an NSAttributedString _textLayer.backgroundColor UIColor clearColor .CGColor _textLayer.wrapped NO CALayer layer self.navigationController.toolbar.layer self is a view controller contained by a navigation controller _textLayer.frame..

Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints?

http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints

cant give the performance and functionality that you would expect from a good PDF viewer. You can draw a PDF page to a CALayer or to a UIImage . Apple even have sample code to show how draw a large PDF in a Zoomable UIScrollview But the same issues.. time render of new zoom levels. CATiledLayer Method Theres a significant Overhead time drawing a full PDF page to a CALayer individual tiles can be seen rendering even with a tileSize tweak CALayers cant be prepared ahead of time rendered off screen.. Overhead time drawing a full PDF page to a CALayer individual tiles can be seen rendering even with a tileSize tweak CALayers cant be prepared ahead of time rendered off screen . Generally PDF viewers are pretty heavy on memory too. Even monitor..

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

shadow effect on UIView layer I have the following CALayer CAGradientLayer gradient CAGradientLayer layer gradient.frame CGRectMake 8 57 296 30 gradient.cornerRadius 3.0f gradient.colors..

How do I reset after a UIScrollView zoom?

http://stackoverflow.com/questions/448285/how-do-i-reset-after-a-uiscrollview-zoom

standard scale of 1x1 after zooming and how do I have a smooth zoom throughout Edit New findings The error seems to be CALayer retainCount message sent to deallocated instance I'm never deallocating any layers myself. Before I wasn't even deleting..

Round two corners in UIView

http://stackoverflow.com/questions/4847163/round-two-corners-in-uiview

c rounded corners share improve this question as far as I know if you also need to mask the subviews you could use CALayer masking. There are 2 ways to do this. The first one is a bit more elegant the second one is a workaround but it's also fast... to do this. The first one is a bit more elegant the second one is a workaround but it's also fast. Both are based on CALayer masking. I've used both methods in a couple of projects last year then I hope you can find something useful. Solution 1.. mask MTDContextCreateRoundedMask self.view.bounds 50.0 50.0 0.0 0.0 Create a new layer that will work as a mask CALayer layerMask CALayer layer layerMask.frame self.view.bounds Put the mask image as content of the layer layerMask.contents..

composite colors: CALayer and blend mode on iPhone

http://stackoverflow.com/questions/1658751/composite-colors-calayer-and-blend-mode-on-iphone

m_overlayRect withImage m_currentImage whiteLayer renderInContext myContext Is there something wrong iphone calayer blend mode share improve this question I managed to get the affect of compositing multiple CALayers by drawing them..

Using CALayer Delegate

http://stackoverflow.com/questions/2015353/using-calayer-delegate

requiring implementation of delegate methods required a protocol specification for implementers to conform to. iphone calayer share improve this question The lightest wight solution would be to create a small helper class in the the file as the..

Disabling implicit animations in -[CALayer setNeedsDisplayInRect:]

http://stackoverflow.com/questions/2244147/disabling-implicit-animations-in-calayer-setneedsdisplayinrect

use instead I also tried setValue forKey with kCATransactionDisableActions same result . iphone ios core animation calayer share improve this question You can do this by setting the actions dictionary on the layer to return NSNull null as..

Rounded UIView using CALayers - only some corners - How?

http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how

Is it possible IF yes then How Thanks in advance for sharing your knowledge. Sagar. iphone objective c xcode uiview calayer share improve this question I used the answer over at How do I create a round cornered UILabel on the iPhone and the..

Animating a custom property of CALayer subclass

http://stackoverflow.com/questions/2395382/animating-a-custom-property-of-calayer-subclass

position etc . Is there something I can override to make my custom myInt property animatable iphone core animation calayer share improve this question Yes it's possible only in the latest Core Animation releases though I believe i.e. iPhone..

CALayers didn't get resized on its UIView's bounds change. Why?

http://stackoverflow.com/questions/2504151/calayers-didnt-get-resized-on-its-uiviews-bounds-change-why

solve this I've just started Googling but haven't found any useful. Thanks in advance. iphone ios objective c uiview calayer share improve this question I used the same approach that Solin used but there's a typo in that code. The method should..

How to tile the contents of a CALayer?

http://stackoverflow.com/questions/2520978/how-to-tile-the-contents-of-a-calayer

setContents self.background.CGImage I would like to avoid subclassing if I could. iphone cocoa osx calayer share improve this question You can create a color with a pattern image and set that as the background color of the..

iPhone: CALayer + rotate in 3D + antialias?

http://stackoverflow.com/questions/2686027/iphone-calayer-rotate-in-3d-antialias

of the CALayer but that didn't help the defaults are that every edge should be antialiased... thanks iphone 3d calayer antialiasing share improve this question You could try adding some transparent pixels around the edge of the image either..

What causes this error? “CALayer position contains NaN: [240 nan]”

http://stackoverflow.com/questions/3025176/what-causes-this-error-calayer-position-contains-nan-240-nan

message in its exact form . Has anyone else encountered this that knows what to do about it iphone core animation calayer share improve this question Decided to take this out of comments and put it as an answer since I think it's a darned..

Why masksToBounds = YES prevents CALayer shadow?

http://stackoverflow.com/questions/3690972/why-maskstobounds-yes-prevents-calayer-shadow

path.CGPath self.myView.layer.shouldRasterize YES Do you have any ideas on this iphone uiview ios calayer shadow share improve this question Because shadow is an effect done outside the View and that masksToBounds set to YES..

How to prevent CALayer from implicit animations?

http://stackoverflow.com/questions/3884242/how-to-prevent-calayer-from-implicit-animations

to be slightly animated. But I don't want that in my case. How can I set the backgroundColor without animation iphone calayer share improve this question You can wrap the change in a CATransaction with disabled animations CATransaction begin..

Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints?

http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints

brow leaves paging with nice transitions skim everything it seems PDF reader editor for OSX iphone ios ipad pdf calayer share improve this question I have build such kind of application using approximatively the same approach except I cache..

Why animating custom CALayer properties causes other properties to be nil during animation?

http://stackoverflow.com/questions/4016496/why-animating-custom-calayer-properties-causes-other-properties-to-be-nil-during

works I've performed intensive searching but I'm stuck with no clue. Anyone knows iphone animation properties calayer nil share improve this question If I understood your question correctly it goes like this. When you add an animation..

Saving UIView contents in iOS 4 with real size of the images inside (i.e. scale contentes up for save)

http://stackoverflow.com/questions/4213529/saving-uiview-contents-in-ios-4-with-real-size-of-the-images-inside-i-e-scale

again since it's already done ... p.s. if anyone has an answer including code would be nice iphone uiview ios4 calayer retina display share improve this question Here is the implementation for rendering any UIView to image working also..

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

layer but again not sure how to achieve the inner shadow effect like this Help appreciated... iphone core graphics calayer share improve this question For anyone else wondering how to draw an inner shadow using Core Graphics as per Costique..

Create a UIImage by rendering UIWebView on a background thread - iPhone

http://stackoverflow.com/questions/4660999/create-a-uiimage-by-rendering-uiwebview-on-a-background-thread-iphone

behavior neither of them . I'm pretty close to giving up. Is there a savior among you people iphone ios uiwebview calayer cgcontext share improve this question UIWebView hates and I mean really hates having anything done to it on a background..

How to get touch event on a CALayer?

http://stackoverflow.com/questions/573372/how-to-get-touch-event-on-a-calayer

in 3D space. I refuse to believe I'm the only one who's curious about this. I appreciate any help iphone events touch calayer share improve this question ok answered my own question let's say you've got a bunch of CALayers in your view controller's..

What's the best approach to draw lines between views?

http://stackoverflow.com/questions/5847876/whats-the-best-approach-to-draw-lines-between-views

method using CGContext functions Something else Cheers for the help iphone cocoa touch core animation core graphics calayer share improve this question Conceptually all your propositions are similar. All of them would lead to the following..

Custom image mask in iOS

http://stackoverflow.com/questions/5880597/custom-image-mask-in-ios

approaches to crop image in custom way. I don't know how to solve performance problem . Thanks in advance. iphone ios calayer puzzle cashapelayer share improve this question There are lots of UIImage categories out there you can use for this...

CALayer: add a border only at one side

http://stackoverflow.com/questions/7022656/calayer-add-a-border-only-at-one-side

http iphonedevelopertips.com cocoa add rounded corners and border to uiwebview.html iphone objective c core animation calayer share improve this question i have solved in this way leftScrollView.clipsToBounds YES CALayer rightBorder CALayer layer..