maintains position in any rotation

I have done some drawing on one layer now I want to draw same thing on another layer.So I have stored all the points of drawing that user has drawn on first layer.And then using convertPoint: toLayer: method converting stored point into points of another layer. And its working.But creates problem in orientation. If I have done drawing in portrait. Then it will work only for portrait in landscape position will be change. So please suggest any way to get out of this.Thanks Normalise your stored points, such that the x, y positions are relative to a surface of size 0..1, 0...

Autolayout UIButton and UILabel font size according to specific type of the iPhone size[NOT PROGRAMMATICLY]

I want to set different font size according to the IPhone size (4, 4.7 or 5.5 inch) Here is one of the solutionBut I want to ask is there is any way to auto resize UIButton / UILabel font size through interface builder without code? For example, how it works with holding ratio width - height of the UIsmth size?If there is no way to do it as I described - what is the best practice to set font sizes. Should I do it as separate file for each UI element or it s better to do it in the appropriate UI elem subclass?To concrete the question - I'm writing an web app for iPhone portr...

Cocos2d: One layer on top of another - Is it Possible to temporarily deactivate touches for a certain layer/region?

I have a scene where there is a button. Once I click the button, a rectangular sprite slides in from the left side: http://img255.imageshack.us/img255/9867/slidei.png Under this shape, there are several touch sensitive buttons. I don't want these to be called when I touch on the rectangular shape. So, as long as the shape remains on the screen, those touches should not respond. Instead, there are several other buttons on top of that brown shape, that respond to touches. How can I manage that? Is it possible to temporarily deactivate touches for a certain layer in a scene? H...

CABasicAnimation disabling any touch activity within animated layer

- (void)fadeOutStuff{ CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"opacity"]; anim.delegate = self; anim.duration = 0.25f; anim.removedOnCompletion = NO; anim.fillMode = kCAFillModeForwards; anim.fromValue = [NSNumber numberWithFloat:1.0f]; anim.fromValue = [NSNumber numberWithFloat:0.0f]; [self.searchList.layer addAnimation:anim forKey:@"animationOpacity"];}I have this code to simply animate an object in and out, and after the animation is complete, the layer is not touchable. Is the animation process setting the layer down a le...

uiimageview retain position on scrollview zoom

I have a scrollview with an uiimageview represented as a tiled layer, it is a static map. I have an imageview for pin over it. when the user zooms in and out of the map, I need the pin to retain its position, and also increase in size proportionately so that it is still visible at a smaller zoomscale. I can see this happening seamlessly in google maps. When you zoom out, the pin changes size at the same time.I tried implementing the scrollviewdidbeginzoom and endzooming methods, hiding the pin when the user begins zoom and putting it back at a recalculated position at the e...

How do I show a view similar to UIActionSheet, on top of everything that's on the screen

I have a view with a UITextField which is the first responder. I'm trying to add a semi-transparent view with an activity indicator that would cover everything.Right now the code looks something like this:CATransition *animation = [CATransition animation];[animation setType:kCATransitionFade];[self.window.layer addAnimation:animation forKey:@"fade in spinner"];[self.window addSubview:spinnerView];This works great when the view doesn't have an active UITextField, but if it does, the virtual keyboard manages to stay on top of my spinnerViewFrom what I've read, "modal" subview...

How do I apply a perspective transform to 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, pointers or example code snippets would be really appreciated! As Ben said, you'll need to work with the UIView's layer, using a CATransform3D to perform the layer's rotation. The trick to get perspective working, as described here, is to directly access o...

Why is this object being released?

I'm getting an EXC_BAD_ACCESS when releasing newImage on the last line of the following code snippet:UIGraphicsBeginImageContext(newSize);[image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();[self setImageToSave:newImage];[newImage release];I'm assuming that newImage is released with the call on the preceding line. If so, why is it being released in the setImageToSave method? Looks like this line:UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();is creatin...

iPhone: how to take screen shots programmatically when using 3d layer transformations

I am trying to programmatically save an image of the current view to a UIImage.the current view contains a background, and a number of UIImageViews that have had a 3d transformation applied to the layer, e.g.CATransform3D t = CATransform3DIdentity;t = CATransform3DRotate(t, rotationX, 1.0, 0, 0);t = CATransform3DRotate(t, rotationY, 0, 1.0, 0);object.layer.transform = t;I am currently grabbing a screenshot of the current view with the following code:UIGraphicsBeginImageContext(background.bounds.size);[background.window.layer renderInContext:UIGraphicsGetCurrentContext()];UI...

How do I maintain consistent email signature html font sizes between a computer and iPhone?

I'm creating a new corporate email signature for our company, and while it looks great on computers, the font sizes change when I look at a test email using my iPhone's native mail application. I'm unaware if Android phones are affected in the same way, but my guess is yes.Code I'm using:<div style="float:left;padding-right:20px;"><a href="http://pinetreecommercial.com/twenty"><img alt="Pine Tree Logo. Now in our 20th year of business. Learn more at pinetreecommercial.com/twenty." style="padding-bottom:15px;" src="http://www.pinetreecommercial.com/public-down...

How do I save the state of a UIImage or UIImageView?

So I've let the user transform a UIImage inside of my custom TransformView which is a subclassed UIImageView. It allows the user to rotate, scale, and pan using touchesEnded, touchesMoved, etc. Now what I'm trying to do, because my image is so large and takes up too much memory, is to remove it from view and set it to nil when the user switches tabs.How do I save the state of the image so that it can load again from the same position? I want it to have the same zoom level, rotation, and position on screen. Any thoughts? Thanks so much! It depends on how you did your tran...

Text not sizing correctly on an iPhone

I'm trying to sort some cross browser compatibility issues with my company website, but I've hit a brick wall.On an iPhone (4, 4s, 5, 5c and 5s), the navigation in the header is displayed incorrectly, and is not resizing with the rest of the page.On other mobile platforms, in (I think) the most used browsers (Firefox, Chrome, Dolphin, Opera), the text re-sizes in relation to the rest of the site and fits correctly.To fix the problem, I've tried setting the font-size property by both px and em, but the result is the same either way.Is this a known issue with iPhones/Safari? ...

Xcode 4 - "Valid signing identity not found" error on provisioning profiles on a new Macintosh install

I had a Macintosh I used to develop iPhone apps with using XCode 4.I now have a new Macintosh with a new install of... everything.When opening Xcode projects built on the old Mac, I cannot run the app on the iPhone that was configured as a development iPhone.Xcode 4 organizer tells me "Valid signing identity not found" on my provisioning profiles.I guess this is something to do with the .certSigningRequest file I had generated before on the old Mac (I have a backup of that file), but what do I have to do with it on the new Mac?Another strange thing, I don't see my 5 existin...

IOS 7.1: UIButton's selected title not working

This question already has an answer here: UIButton's Selected State not working in iOS7 3 answers Fixed it!Finally I was able to fix it and it was because of improvement of UIButton behaviour in iOS 7.1.They just started rendering round-rected shape filled with tint color when UIButton is selected.It was semi-transparent one in iOS 7 and I remember that I put clear color just to make the buttons clear to see.That was the issue and they rendered transparent rectangle around the butto...

How to draw arc/curve line with MKOverlayView on MKMapView

Help needed now.I can draw lines with MKPolyline and MKPolylineView, but how to draw an arc or curve lines between two coordinates on the MKMapView?Great thanks.The Final SolutionFinally I wrote myself these conclusions here to help who want it.If you want to:just draw arc path on mapjust draw an image on mapcombine arc path and image as overlay on mapSo the solutions are:There are MKPolyline and MKPolylineView to draw lines, MKPolygon and MKPolygonView to draw polygons, MKCircle and MKCircleView to draw circles. No one fit? Where is an arc? Oh, yes. Now the really solution...

I can't declare this property in the .h file, can i do it in the .m?

I want to create a property out of a view which already has my class imported into it's own .h file, and therefore I cannot import it's .h file into my .h file because it causes problems. This means i have to put it's import into the .m file.Putting this into the .m file:View1 *view1;works fine. But putting in a @property causes problems. I can't seem to find where best to put it to not cause an error. Is there a workaround to this? You can put this in your @interface in your header file without importing View1.h. Just use a forward declaration like this:@class View1;@in...

Page 1 of 207  |  Show More Pages:  Top Prev Next Last