I've developed an application for the iPhone, showing a UIAlertView with two buttons. One that says "Cancel" and one that says "Send Challenge".
This works fine on the iPhone. But on the iPhone 4, the "Send Challenge" gets truncated to "Send Challe..."
Seeing as how the iPhone 4 is supposed to be exactly the same as the iPhone just with twice as many pixels, it seems odd that the text isn't scaled up to be exactly twice the size as well. Any thoughts on how to fix? I've seen it happen in several places, but most of the other places, I was able to get around it by changing the label size by adding a few pixels. I don't think I can do that with a UIAlertView.
You can roll your own alert system. Try looking at the excellent MBProgressHUD for tips on how you might be able to start with something like this
Haven't found a real solution to this other than changing the text to be shorter. Really annoying that the iPhone 4 isn't exactly 2X from the iPhone.
Related
I've developed a personality quiz app here entirely in code. Some of the separators keep disappearing though - it's not consistent from question to question, but it's usually one or two in the middle.
I can update with code, but I'm not sure what aspect of TableView's code is causing this problem.
Are you take the screen shot from the simulator ? if it's from simulator, it's normal, as the mac book don't have enough pixel to display the separator.
change your simulator to iPhone 8 would be fine.
I am new to UI design, however a client wants an app ready for both iPhone 4s & 5.
I understand the iPhone 5 will create two bars if the image is not long enough. Many people said coding it at #2x will solve the problem. But I'm not sure exactly what that means.
Do I need to design two versions? What happens if I design only for iPhone 5? Will iPhone 4S users see a squished screen?
Thanks.
First, in a couple of months you'll have to support the iPhone 5's screen size. Apple have announced that it'll be a requirement soon.
Adding a Default.png of the right size is enough to enable an app to support the new screen size but is likely not enough. You'll also need to make sure that all your views resize to fill the screen. There's the old "springs and struts" method and the newer "constraints." There are tutorials you can search for -- Stackoverflow is not a good place for that kind of thing. You'll also need to update any images.
In short, try it in the Simulator and see what happens.
Using #2x is referring to whether or not the image asset is being displayed on a 'retina' screen. For example, if you had a 50x50 pixel image, the 'retina' (#2x) version would be 100x100. This is because 1pt (point) is equal to 2px (pixel) on a retina screen.
There are a variety of ways you can determine is it is an iPhone5 or iPhone4.
In the viewDidLoad, you could check the self.view.frame.size.height to determine which background image to load based on the height of the screen. This would require you to have two different versions of the assets (not including #2x versions), i.e. bg_iphone5.png & bg_iphone4.png.
There are other ways to accomplish this, and people have explained it better than I have here - search StackOverflow and you will surely find what you're looking for.
What happens if I design only for iPhone 5? Will iPhone 4S users see a squished screen?
Don't do this. Design for both.
I have an alertView that pops up when reachability has detected wifi. I have both english and french translations of this. The problem is the french version's text is a bit longer, and I do have some line breaks in there.
When the text is too long, the alertView changes to a white background with a scrollable text view. Is there any way around this? The strange thing is that this only happens on retina devices (or non-retina when in landscape, but that makes more sense). Non-retina devices show the whole message normally. It seems like retina devices having more landscape shouldn't make this happen.
Help?
Thanks in advance.
First of all retina devices would produce the same results seeing as they have the same amount of screen real-estate. The difference is in pixel density, which means that an object on retina will be the same physical size but will actually be using 4 times the pixels which produces a much clearer and sharper image.
Secondly, there is no way you can avoid this. UIAlertView is a class that Apple allows VERY little customization of, so you may be better off making a custom view and presenting it yourself. This is probably only happening in landscape mode because the alert gets less screen area under these circumstances.
So overall, I would recommend that you either create your own custom pop-up or you trim down the amount of text you're displaying in the alert.
I recently deployed my first iPhone app, a simple game, to my testing iPhone for the first time. Everything looks and runs fine on the simulator in Xcode, but on the iPhone the whole image is shifted up about 10 pixels or so. So the gameplay goes slightly offscreen on top and has a slim white/grey bar at the bottom. Has anyone encountered this before? I do have the status bar display turned off, I'm wondering if the device handles that flag differently than the simulator. I also have the rotation hardcoded to be in portraitRight mode at all times, and I have an extra line in the code to make the simulator do that automatically that's apparently not necessary on the device.
Everything is very simple, so I'm not sure where this glitch is coming from or even where to look.
Did you use Interface Builder to create your UI? If you did, then go and check each and every XIB file(s) objects' Size & Position as well as Autosizing in Size Inspector (command-3).
It's very important to check both: your coordinates might have gone wrong after some change you did and autoscaling works in weird ways unless you attach to correct edges. Apple documentation should help http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/IB_UserGuide/Layout/Layout.html
For example, preparing a launch screen of 320 x 480 would have to be changed....
How is that going to work for us? Are programmers always going to have to be submitting a high-res that will be scaled down for old devices such as the iphone 3g?
The size of the screen is basically 4 times on a pixel by pixel basis. So each pixel of your image for example gets boosted to 4.
What this means for you? You don't have to change your App, your app will scale to the hi res screen for you, same with your UI and images within your UI. Of course if you want to take advantage of the better screen quality you will have to submit hi res images.
I haven't looked at going the other way but I believe it would be a similar case.
One exception to this is text. It automatically scales to the higher res for you for free. So text will look super sharp. One problem with this is if your loading image has text based on the original load screen that wouldn't look the same as when the high res text loads.
Strictly speaking, anyone who's seen the documentation on how they're handling this is still under non-disclosure until Monday, when the new iOS ships.
Suffice to say, it's clever. You'll be able to put both high and low-rez versions of ALL your images into your app, and then load them into your app in a way that's totally transparent from the code side. The device will make its own call about which version of the image is appropriate for the kind of screen it's got.
Now that the WWDC 2010 videos are available for free to any registered iPhone developer (or ADC member), I recommend watching Session 134: Optimize your iPhone App for the Retina Display for a full description of what you need to do to support the iPhone 4's new display.