iOS UIImageView beneath UITableView doesn't display correctly - ios

I'm building a UITableView via the StoryBoard in XCode 6.3.1 for iPhone 6 app.
On this TableView, I want all of my cells, then beneath that, a UIImageView. I tested it for a small placeholder image, and it worked great. All of my cells display properly, and the image shows up beneath them.
The problem comes when I use my actual image (it's the size of the full screen). I want it to go directly below the Tableview, and have the bottom be viewable when the user scrolls down.
I tried messing with the view's attributes, and everything kept giving me some sort of issue. The default view mode of "Scale to Fill" makes the image look extremely distorted. Changing it to Aspect Fill makes the Image look perfect, but it makes all of the cells disappear when I run it (though not in the Storyboard for some reason)
Is there any way I can get the cells to display correctly, then place the undistorted image beneath it?

Related

xib shows blank box even we have many view and other designing in Xcode

I am using xib and it just shows blank square box even I have done designing and added many views.
Please check attached image no matter its huge designing or just 1 - 2 labels it shows the only square box.
but if I run it will woks perfectly in the device.
My Xcode version is 10.2.1.
You can try one of the following options to debug this issue:
Drag the main view to increase its size and give it some background color which can be seen easily(like red).
Try populating the labels with text in the XIB so that they take up some space and expand the views dependent on them.
Give height constraints to all the views to check if they are visible.

Xcode UITableView image does not align properly on simulator

I am working on a project on Xcode7.3 using swift using autolayout. I am stuck with an problem with the UITableview not displaying properly on the simulator.
I created a ViewController and dragged a TableView into ViewController. Then I dragged a UIView and UIImage ontop of that TableView (To display as a header image). I also dragged a UIImage onto the prototype cell. They are all aligned in the center horizontally and vertically. However, when I run the app, they don't show in the middle of the screen.
As shown in the UITableView_Problem Image, the images are offset to the right. What is also weird is that when I rotate the screen, the scrollbar on the right does not go all the way to the right. The images appears to be in the center of the screen if I consider where the scroll bar is the end of the screen. But that doesnt make sense because the bottom bar items spans the full width of the screen.
However, if I create a UITableViewController from the story board instead of dragging a TableView onto a ViewController, I do not have a problem at all. (Image3)
It is frustrating because I wanted to add a text field for keyboard at the bottom of the screen just like the comment section in Instagram app. And after hours of searching, it appears that the only way to do that is to drag a tableView onto a ViewController. i stack imgur com JC5Pw png
Could anyone please assist? Much appreciated
Blockquote
note: I dont have a developers account yet so I cant check on an actual device
You are designing your interface in the wRegular/hRegular (or universal) size class. You will need to be very good about your constraints or develop a layout for the wCompact/hRegular size class for iPhones in portrait mode. You can change this by selecting here the blue part on the bottom of your storyboard
Thanks Dan for your prompt response! I added constraints to everything except for the tableView. Dont know what I was thinking as I have been troubled by this bug for a few days. Everything works fine after the tableView constraints was set!

iOS 9 UIImageView scaling is erratic

I have a UICollectionView in my app. Each cell is about a third the width of the screen (in portrait orientation) and is square. Inside each cell is a UIImageView whose mode is set to "Scale To Fill" (in IB) and has constraints on each edge that force it to fill the cell.
On iOS 7 and 8, images would consistently perfectly fill each cell.
On iOS 9, scaling varies each time the view appears, and sometimes changes when the cell is clicked:
images sometimes are small, and sit in the upper left hand corner
images sometimes scale to fill as they should.
images sometimes scale slightly larger than the cell, and change size when the cell is selected.
images sometimes disappear completely when a cell is selected.
If it somehow matters, the image gets set in the cellForItemAtIndexPath method of the collection view like this:
cell.artImageView.image = artImage;
Where "artImage" is a UIImage. (Obj-C).
UIImageViews are pretty simple and straightforward. Did Apple "improve" them with some new property I need to set? Really stuck here.
Update: Tried to reproduce this in a new project and couldn't. Some kind of weird leftover IB juju. But totally replacing the collection view controller, cell and image view in IB did not fix the problem.
It turns out there was an extra view that wasn't "installed" for the size class.
I had this:
And changed it to this:
And now everything looks right!

MWPhotoBrowser - Images moving inside view

I am sure this is an easy question, but I am lost. I have MWPhotoBrowser and a bunch of photos loaded into the browser. Everything works beautifully, except if I click on an image in the browser and drag it around the screen it moves everywhere and repositions the image. Essentially I just want to stop if from dragging around all together.
Any recommendations ?
There were two issues causing this problem:
Autolayout was turned off. Since I wanted it to remain off I had to create a work around with #2.
The content appears to be sized to the View. In my case the view height was much larger than the available display area on the screen. To work around the issue I used another view sized to the viewable area and added the browser to that view rather than the super view.

Custom UITableViewCell elements getting cut off in the Interface Builder

I'm just getting started with iOS development. I am trying to make a custom UITableViewCell for an iPad-only app.
I am using XCode 4.2 and the latest iOS 5 Beta.
When I'm trying to build my interface, I can't place an elements or make any elements wider than about half of the cell size that's displayed. In the screenshot attached, I want to place the "Name" label on the far right side and stretch the progress bar to the far right side as well. However, when I stretch the progress bar out any further, it just gets cut off.
I'm sure I'm missing something...any ideas?
If it is allowing you to stretch the progress bar the entire length and then cuts it off after you release it, then there is probably another object (i.e. custom button, image view, etc) on the right portion of your cell that is higher on the view stack.
Check in the Objects section of Interface Builder to see if that is the case. Then you can adjust accordingly.
I'll like to make a little guess here...does it have to do with the orientation of landscape/portrait? It looks like the cell is landscape but the view is only for portrait...
check every controller with background color property. set the different color for every one. Might be it's overlapped one view over second view.

Resources