IOS - fit image and textView IB - ios

I am new to IOS. I have a ViewController in which i add a Container in it. Then there is another ViewController in which i have a image and after the image there is a text view. The problem i am facing is when i run this app on Iphone 5 everything works perfect But when i run the app on Iphone 4s, the space grey bar appear between image and textView.I dont know how can I resolve this issue.
here are the images
I want to ask one thing more is I want to start the text in textView after two or three line breaks from top.How can i start a text after some line breaks starting from top?

Try Using auto-layout if you are using autolayout else try autoresizing for the views as iPhone 5 is 4-inch (320*568) display and iPhone 4s is 3.5-inch (320*480). So the issue is because of the different resolutions.

Related

iOS: Auto-layout constraints acting strange when designing TableView for iPad

I am trying to have simple custom table view cells with UIImageView and another View with three Labels in it.
I set the constrains to 5 from UIImageView and 0 from all remaining sizes. But as soon as I select bigger iPad in the Xcode designer (like iPad Pro or Pro with 12,9" screen) I suddenly get space on the right side even though the constraints still says "0" when clicked.
The screenshot below should help illustrate the issue (first is regular iPad, then iPad Pro 10.5" and finally iPad Pro 12,9"):
I already did some auto-layout work for iPhone and never encountered something like this.

Xcode 7.1.1 UINavigationBar does not cover the entire width of the screen with iPhone 6 and above

My app was acting fine till I updated my Xcode. For some odd reason, my UINavigationBar is no longer covering the entire width of the screen for devices iPhone6 and above.
For iPhone 5:
For iPhone 6 and above:
I think you didn't used autolayout. Okay no problem..
Follow below steps:
1. you need to keep it empty on Launch Screen file.
2. Create Launch image source and then add iPhone 6 and 6+ splash screens
Then it will work your navigation bar automatically fit based on device.

How to remove keyboard enlargement in ios objective c

I want to show keyboard smaller but causing problem. Please compare both images, keyboard size is bigger in first image than second image and also vertical spacing between two character is more . I have already added Retina 4-inch launch image ,Retina HD 4.7 inch launch image and retina HD 5.5 launch image. Keyboard is showing proper in iphone 6 but my app design causing problem when i run in iphone 5. How I can show keyboard smaller without design problem? I have searched a lot but couldn't get solution of this problem.
This is image shows the proper keyboard size which I want in my app.
this is my iPhone 5 design image, here keyboard is looking starched.
see this is my iPhone 6 design image, it is looking fine.

How can I get the Xcode storyboard and the iPhone Retina (3.5-Inch) simulation to use the correct xcassets images?

Weird problem here which may be a bug in Xcode...
Using an Xcode 5.1.1 storyboard with auto layout, I am working on the design of a view controller that contains a full iPhone 4 sized UIImageView that references an xcassets image set. The xcassets image set includes 1x and 2x iPhone 3.5-inch images, and an iPhone 4 R4 image.
Problem 1: Once I set the Image View Image for the UIImageView in the utilities panel using a View Mode of Aspect Fit, the storyboard shows the smaller iPhone 3.5 image with white spaces at the top and the bottom of the view instead of the iPhone 4 image which would fill the entire storyboard representation of the view, as they are the same size since Xcode infers an iPhone 4 sized screen in the storyboard.
Problem 2: If I ignore problem 1 and run the program using the iPhone Retina (4-Inch) simulation, the applications selects the correct image size from xcassets and everything seems fine. However, if I run the simulation using the iPhone Retina (3.5-Inch) simulation, the applications also selects the correct sized image, but pushes the images down and display white space at the top of the page.
Before I start hacking around these problems, I thought I would reach out and see if anyone else has experienced either of these issues. Any help will be greatly appreciated.

Displaying different images for iPhone 4 & 5

This seems to be an interesting problem that I'm getting. I'm developing an iPhone app for iOS 6+ devices and optimizing the images for both iPhone 4 & 5. Now I have implemented this into my project: Xcode 4.5 background image iPhone 4, 4s, 5
The problem is in interface builder I'm designing the UI with the iPhone 5 screen, so the UIImageView is 320x568. But when I test on iPhone 4, the image is being stretched and looks terrible. However, the specified image for the iPhone 4 screen is displaying, i just want its dimensions to be 320x480
Hope someone can help!
From the inspector view in the interface builder, you can edit the stretching behavior of the view when the size of the super view changes. You can click the red arrows inside the square to control that.
Also I suggest that you check UIView contentMode. You can edit that from the inspector view in the interface builder "third tab from the right.
In the UIImageView's inspector, try playing with the Mode property. The Aspect Fill or Aspect Fit may get what you're looking for to handle the different screen sizes.

Resources