I'm really new to iOS coding, and I have a UI question.
In the simulator, my app has rounded corners like this: http://i.imgur.com/cc8eM.png
I like that!
But on the actual iPhone, they look like this: http://i.imgur.com/hyVKu.png
How can I make the iPhone version have those rounded corners? Thanks!
That's a new iOS6 UI feature, but good eye.
Are you making this effect by just set the view.layer.cornerRadius= 3.0 or just let your artist cut the image?
if you are using this property: view.layer.cornerRadius= 3.0, these two properties should get take into consideration: view.layer.masksToBounds = YES; view.clipsToBounds = YES;
You can just find the explanation in the iOS documentation.
thanks for all the help. I eventually just photoshopped them in, but I did find my problem. I'm using the newest Xcode beta, which has the iOS 6 sim, and in iOS 6, apps with black status bars have round corners added automatically. My iPhone was running 5.1.1, and therefor didn't behave like this.
if you want your whole app to be rounded --> go into the AppDelegate and
#import <QuartzCore/QuartzCore.h>
and add these lines of code to the window:
self.window.layer.cornerRadius = 3.0;
self.window.layer.masksToBounds = YES;
Related
I have used this background in older version, after updated to iOS 6.0 I am not able to find anywhere in IB. I stack overflowed and used this
self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
Still it is giving white color, What should I do now? Do I need to set image for this?
This function groupTableViewBackgroundColor deprecated on iOS 6. Please set color or image in Background mode
please see the SO answer
I would like to get screenshot of mapview. So i used following code. This code works perfectly in ipad and simulator but not on ipod. The iPad has iOS 6.0 and my xcode is 4.2.1 and the iPod has iOS 5.0.
- (UIImage*) renderToImage
{
UIGraphicsBeginImageContext(mapView.frame.size);
[mapView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return viewImage;
}
The problem is, i have got same image in iPad, iPod ans simulator but not names corresponding manual screen capture and programatic screen capture.The names are very big in iPod, at the same time names are normal in iPad and simulator and also some names are invisible in iPod.That is the my problem.
The following images are:
This image belongs to iPod manual screen capture.
This image belongs to iPod programatic screen capture.
I don't know where the problem is. Please help me anyone.
The problem is UIGraphicsBeginImageContext(mapView.frame.size); here. I have just replaced this to UIGraphicsBeginImageContextWithOptions(mapView.frame.size, NO, 0.0);. Then it is working in iOS 5.0.
You can tell by looking at the app in each situation, it's not your screenshot code that is magically creating different maps, the underlying maps are different.
My cocos2D app, Forever Afloat, works perfectly fine with all the combinations until you get to iPhone 5 and iOS6!
The app display is all stretched out so that you see only the lower left corner and the rest is off the screen.
Only until you force it to autorotate, does the app begin to display at proper dimensions...
My problems can also be found at this problem cocos2D iOS 6 retina display
They asked the same question.
Any solutions?
Thanks!
cocos2d uses image with image-hd.png and not image#2x.png
Check whether you are using #2x an replace by hd
Use new version of cocos2d and here is image extension.
-wide.png for iphone 5
-widehd.png for iPhone 5 HD
-hd.png for iPhone HD
-ipad.png for iPad.
-ipadhd.png for iPad HD.
There were some issues within the AppDelegate regarding the order of calls that made the display all strange. All I did was move the initalization method to the top and it fixed everything!
I have a background image being placed by the following:
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"v3_bg.png"]];
However, my image, which is 960x640 does not scale correctly when i run the simulator, in both v3 and v4 of the iphone. Could some one please help explain to me why the iphone simulator 4 does'nt use the full size of the image, it seems to only just scale up what the v3 displays.
Thoughts?
In the Simulator, go to Hardware>Device and select iPhone(Retina) rather than iPhone.
I have an app under development that worked fine under iOS 3.1.x. I was at a good break point, so I decided to upgrade my dev environment to XCode 3.2.4 + iOS4.1.
My app has a number of UIButtons that I made colored using the "stretch a colored image as background" technique described elsewhere on StackOverflow:
UIImage *myImage = [UIImage imageNamed:GREEN_BTN_IMAGE];
UIImage *stretchableMyImage = [myImage stretchableImageWithLeftCapWidth:12 topCapHeight:0];
[myBtn setBackgroundImage:stretchableMyImage forState:UIControlStateNormal];
This worked great until I recompiled using my new environment. Now, the button is basically transparent, with the text showing. I can't seem to get the coloring to show up, no matter how much fiddling I do with the IB version of the button or in code.
Any ideas on what might be wrong? Also, is there a good resource somewhere for other 3.1 to 4.x migration gotchas? I've been looking through the WWDC videos, but have not stumbled upon anything yet.
Thanks.
I think, you have to update your image resources to high resolution. Since iPhone 4 has exactly the double resolution as iPhone 3GS. Please look into updated iOS App Programming Guide, "Loading Images into Your Application" section.