Images disappear when switching to 3.5 in iOS - ios

I have two images that I am showing in a UIImageView, they both show up fine when they are edited on the extended storyboard and when ran in the 4in simulator. However when I switch the storyboard to the shorter 4 & 4S size the images disappear, the UIImageViews are still there however it will not display the images. The first picture is of the 4in storyboard and the second is of the 3.5in, all I did was click the resize button at the bottom of the editor to shrink it.

This sounds like a simple layout issue in IB. If you have Autolayout disabled then you need to set some struts for each of the images so that they reposition when the screen size changes. On the right side of IB in Utilities open the Size Inspector panel and set up the Autosizing as in the image below.
Notice only one strut is red, this keeps the content pinned to the bottom.

Related

Limit AutoresizingMask height stretch

I made this screen
Screen on iPhone 4s(9.3)
It looks fine on that device, however when i test this same screen with iPhone6(9.3) it looks like this. Since i cannot post more than 2 links, i merged the third image with the second one
Screen on iPhone 6(9.3) with the Third Image
As you can see, that gray view, doesn't fill the white space beetwen that same gray view and the first bottom button(lojas). Notice that i don't have the autoresizing height stretch on(that vertical arrow inside the blocks). If i turn that on, this happens
Third Image inside the Second Image
See that, the gray view goes over the buttons, i don't want that.
My question is, how can i solve this? Is there a way to make the gray view stop above the Lojas Buttom at the bottom? Thanks for your time!
OBS: I CANNOT use autolayout.
EDIT: Got the problem solved
I just changed the View as option in Interface Builder, changed it to 7.0 and later, so it gave me the "real appareance" of the app.
I changed the View as option inside the Interface Builder so i could see how the app really look like and set the iOS Deltas to 0, made the changes based on that.

Xcode storyboard - can't drag to make constraint, items disappear when switch between size classes

In my project I want the iPhone portrait version to stretch a view but the landscape and iPad version to have a specific width so it doesn't stretch since the iPad is wide and so is iPhone in landscape. The problem is, when I set one up, I switch to the other one and everything has disappeared. If I start dragging views from the left panel to the storyboard they appear again, but when I switch to the previous size class everything has disappeared on that one. I also can almost never drag on that ViewController's box to do what I want. For example, if I want to drag from a UIButton to the background of the layout it would normally bring up a menu with 'vertical spacing' etc but now it comes up with 'Outlets Delegate'.
How do I fix these issues? Nothing is working.
Solved it by deleting everything in the ViewController, re-adding everything in w-Any h-Any and adding specific constraints in the relevant size classes.

Constraint issue with iPad using single storyboard iOS

I am having issues with a specific view on my storyboard. The button and textview don't show in the right place when using the ipad. It works perfect for the iPhone, however. I am using one storyboard for the both of them. (Not one each) Here is a screenshot for what it is showing and the blue rect is for where the textview should be and the red is for where the GPS button, which is visible to the left, should show. Any ideas? I have tried setting and reseting the constraints, but it has had zero effect.
Thanks

Custom UIButton alignment with respect to background image issues in xcode 5 on iPhone 4s and 5 - addition of constraints does not fix the issues

I am having issues with UIButton with background images. When clicking on a button when running the code in simulator and in iPhone 4s and 5, a button seems to be selected even when I press an area outside the button
I have a very simple UI with an image, followed by another image (Login), followed by 3 custom buttons (Facebook, Email and Signup) and an image after that at the very bottom.
Note -
1. I have each button size (width and height) equal to the size of the background image. So if the background image is say 100 by 20, the button would be 100 by 20. Also, I have Autolayout checked and the image to AspectFill the UIButton in the IB.
I have a UIView within the Superview. All the UI elements (images, UIbuttons with background images) are placed in the UIView.
I have constraints on the UIView for width and height, so that it remains the same in iPhone 4s and 5. I also have constraints to ensure that the UIView is horizontally and vertically centered.
Within the view, I have constraints on each UI element's (images and UIbuttons with images) width and height, so that it remains the same in iPhone 4s and 5. I also have constraints on each elements Y location. So, I have a constraint that the first image is X distance from the UIView's top line. Then, I have a constraint that the first button is Y distance from the image on top. Then, I have a constraint that the second button is Z distance from the first button above it. I, then, have a constraint that the bottom-most label is A distance from the bottom line of the UIView. And I have a constraint that the third button is B distance above the bottom-most label. The idea is to ensure that all these elements are in the center of the screen in iPhone 4s and iPhone 5 (since the UIView will move to the center due to the constraints on it and the UI elements within it will move to the center along with it since their constraints are relative to the UIView).
The project supports iOS 6, 6.1 and 7.
I started developing and testing using iPhone 4s. The buttons seemed to be working fine on it. Then I connected iPhone 5 and, on compiling, I found that the buttons' clickable area and the buttons' background image did not overlap anymore. I re-connected iPhone 4s, cleaned the project, built it again and ran it (both on the simulator and on the device) to find that the buttons did not work anymore. On clicking on an area outside the button, the buttons were getting selected. What was also strange was that in some cases, when I touched a button (ie. Facebook), the button below it (i.e. Email) was getting selected.
So, in summary, it worked fine in iPhone 4s. On connected, iPhone 5, it seems that the buttons stopped working properly. On reconnecting iPhone 4s, the buttons no longer functioned properly. I tried removing all the UI elements and restarting the build (in same view controller in the same storyboard), tried creating a brand new view controller in the same storyboard, but with no luck. I have had to start the project all over again to have it function in iPhone 4s. So, to me, it seems that something is corrupting the storyboard, to an extent that it cannot be fixed again!
I have highlighted the UIView in gray for your reference.
Please see the images for reference -
Basic screen with UIView grayed out and no touch
Basic screen with UIView grayed out and trying to click Facebook button -
Basic screen with UIView grayed out and trying to click on the non-clickable image below the Signup button -
Not sure if anyone has faced such problems But, I would love to understand it and fix it now since it is a reoccurring issue and do not want to face it when most of my project is complete as it seems to completely corrupt the storyboard, leaving me to start the project all over again!
Please help.
Did you try calling sizeToFit method on all the buttons?

IOS iPad application bottom strange white area

I developed iPad tabbar application. I also use custom tabbar on left side. Bu Tab bar has white background along edges in landscape mode and also portrait mode. This area could not delete any of the method.
It sounds like the sizes you're using in your nib file don't match the layout in your app. You'll need to set the autoresizing mask of your views so that they resize correctly at runtime.
You can change the autoresizing masks in the nib by opening the right-hand pane; selecting the icon that looks a bit like a ruler, and then clicking the red arrows. Here's a picture:
The important arrows are the ones in the second row; click them so they look like this:
Your view should then resize correctly.

Resources