ImageView width more than cell width in UITableView Cell - XCode 6 - ios

I am developing an application in XCode 6 for iOS 8. I am not using auto-layout. I am trying to put an ImageView in a UITableView cell. When i run the app on iPhone 6/6 Plus:
The size of the imageView becomes double than my cell size if i check all the auto-resizing options.
The size of the imageView becomes lesser in width if i uncheck all resizing options except for the left one.
Is this some bug in XCode? Because I think, if i check all the auto-resizing options, and use scale to fill for the imageView, it should scale up and down accordingly, rather than going out of bounds of the view and cell.
All help is appreciated.

I ended up finding out that it all depends upon the splash screens you have added. AutoResizing proves troublesome on iPhone 6 and 6+ if you have splash screens for them.
But if you remove those splash screens and only keep a splash screen for iPhone 5, then your app will properly scale up and down, hence the bug will be resolved.

Related

Maintain same tableviewcell height in different phone size

I have a table view which contains the setting that looks like current iPhone setting page.
I want the tableview to remain the same size as well as for the image icon for each setting. Much like in iPhone 5 and iPhone 6, even though iPhone 6 is much bigger but the icon size remains the same as iPhone 5.
I've added iPhone 6 and 6+ launch screen and for the image icon, i've set constraint for height as well as aspect ratio. In code, i didn't declare heightForRow and in storyboard, i leave height for tableview cell as default.
Is everything i did correct? or am i missing something? i'm doing the storyboard in wAny hAny size class.
If you do not change the value you have put for the height of the table view cell, will remain fixed for all devices.
See the image for details.

Autolayout change height of the view when app starts

I have UIViewController on storyboard.
On the image you can see top gray is simple UIView while bellow is UITableView.
And I set uiview to be 150 height.
I use autolayout.
Problem is that when I run app on iPhone 6 uiview height is about 40% of the UIViewController.
From some reason it's height is larger than 150.
Can somebody explain me how can I setup view so I have UIView always the same size?
I think the problem is with your view height....you can not give static height.... see the images and check out where you missing out....
and the o/p is in 4.7 , 5.5 , and 4 inch is
for all the height of view is looking same....that is of 150 height
Have you included an iPhone 6 launch image? My guess is that the iPhone is resizing up based on the resolution of the 4" screen. Include either a static launch image, or a dynamic, xib-based one, and I think that should fix your problem.

Why does my View frame size change when using Autosizing in Portrait mode?

I'm trying to understand how Autosizing works. After reading some posts like How to Automatically Resize a UIView When The Orientation Changes, iOS 4 iPhone Rotation, View Resizing and Layout Handling, Understanding UIView autoresizing, ...
I think that Autosizing only works when there is orientation changes so that the View can be displayed properly, but it doesn't. It does resize my View frame size either when I'm only in Portrait mode. Why is that ?
I cannot fully tell from your screen shot, but I assume that in your storyboard the view is in the 4 inch dimensions. Then you are using the 3.5 inch simulator. Since you have made your sizing constraints say in essence...
"Keep my view this far from the top and this far from the bottom, and resize its height to force this"... Your view will shrink that half inch to make sure it matches your constraints.
Try running it in the 4 inch simulator and see if that works.

How to make a view in a XIB/storyboard size to the phone dimensions without using auto layout

I have a scroll view in a storyboard and the app is to run on iPhone4s and iPhone5s with iOS5 and iOS6.
I initially created the storyboard and was running on an iPhone5 and now I'm testing with an iPhone4.
Isn't there a way of just using a single storyboard for both the iPhone4 and iPhone5 and the when views etc. will automatically resize themselves depending upon the device, or do I have to use two separate storyboards?
I've tried numerous things, such as changing the simulated metrics size and many others but I can't find anyway of the view changing its size automatically - as I created the storyboard initially for an iPhone 5 the view now seems stuck at a 548 height when loaded. SUrely there must be a way of specifying in the storyboard that its height comes from the device? (Its height is the full screen less the status screen).
Further details
There is UIScrollView inside a UIView, the UIView will resize, the UIScrollView will not:
Yes, you can do it in the "Size Inspector", inside the Utilities menu. There you can set the autosizing and origin of any visible element.
This works in iOS 5 and 6 and it's not required to use the Autolayout, which is only for iOS 6.
Size inspector:
Second screenshot:
You have to use two storyboards for iphone4 and iphone5. Then you can check the device size to load the .xib according to it.

Xcode UIToolbar Autoresize

I have an iPhone application that runs perfectly on the iPhone 4s but when run on an iPhone 5 some parts of the screen doesn't autoresize. The thing that isn't resizing is the UIToolbar. My application always runs in Landscape mode, so the toolbar is at the bottom of the screen and these are the dimensions of the toolbar:
X: 0 Y: 256
Width: 480 Height: 44
I've tried adjusting the auto-resizing tool to almost every combination and nothing works. I can get the toolbar to spread across the screen, but the 3 buttons stay the same size. Each button is of width = 148. Is there an easier way to have the entire application just automatically resize correctly? For some reason my iPhone app worked great on the iPad when you used the "x2" resize view. Thoughts?
so the OP uses stock items and they don't resize then!
I would add flexible spacer items in between each button -- they resize
To solve my problem I just used IBOutlets that connected to each barbutton and if the screen size was for the iPhone 5, the width would adjust accordingly for each screen, if regular screen (iPhone 4s and below); then stay the same. Not a very efficient way but it worked for me.
Take a look at the images and select the autosizing red lines, if you select the bottom line it will keep on the bottom always, and if you select top and bottom it will stay at the same place. So verify your UIToolBar autosizing properties.
EDIT
EDIT2
Check out this answer How to detect iPhone 5 if you can't autosize, one quick solution that occurs mi if to change the frame in the code. Check if the device is a iPhone 5 or 4S to give a specific frame so you can adjut the width.

Resources