Xcode: Image showing original size in simulator - xcode

I have created some images in UIViews and in scrollviews in a UIViewController. I go to run the app and the images are in scale but have blown up to there original size.
Interface Builder
Simulator
Any help appreciated!

If you click the image in IB, you see a dropdownlist in the left menu called mode in the Utillities pane. There I believe you should choose "Expect fit" or "Expect fill", unsure which you should use. When you choose that mode, the image should not rescale.
I think that is what you are looking for.

Related

Swift - Problems with layout

I have a Universal application in Swift 2.0 developed in XCode 7.
On the storyboard simulated metrics, I have the 'size' set to 'iPhone 4.7-inch'.
When I run the application on my device (iPhone 5s), none of the labels are aligned and the toolbar is out of view. -This is also the case when I run using the iPad device in XCodes simulator.
Image of what the view controller contains ...
From the snippet above, when I run this VC on my iPhone there is no margin on the right side, and the toolbar is cropped off.
Can anyone advise how I can make a universal application show all the content in the VC, on all devices. Or how I would simply show the toolbar ...
That's what auto layout (constraints) is for.
On the storyboard simulated metrics, I have the 'size' set to 'iPhone 4.7-inch'.
That's irrelevant, and indeed misleading, since in means that only on the iPhone 4.7-inch will your app look like the storyboard design — unless you use auto layout.
iPhones come in many screen sizes. Basically, you have no way of knowing, as you design, what the screen size will actually be! Auto layout is the solution. Auto layout allows your interface elements to adjust automatically as the app launches on a particular size screen. iPads can serve as an extension of this — i.e., just an even larger size screen — or you can even use conditional constraints to make the interface quite different on the iPad from the iPhone, if desired - all designed in a single storyboard.
Maybe you are using auto layout and auto constraint. You could deactivate this in opening the storyboard, open up right panel , go to "show the file inspector" section and under Interface Builder Document uncheck auto layout and auto constraint
Image here
Select your item view, go into "Show the size inspector" and there you can set your autoresizing for all devices

Trying to adjust existing app's storyboard to work with iPhone 6 and 6+ screen sizes

I have created new storyboard with auto layout enabled (image below).
The strange thing is the entire view is proportionally stretched. I can't figure out how to leave ratio 1:1. It is not about using auto layout I believe.
The images show the problem:
This image comes from clean app. It shows view on iPhone 6+ simulator. As you see the table cells are 1:1 (smaller then the following example). Also the status bar is fitting with size at the home screen.
This images comes from a new storyboard in existing app. The set up of the story board is exactly the same as in clean app. Moreover the .plist config is matching. As you can notice the cells are bigger, and the status bar is also bigger.
Is this a simulator bug?
I haven't got the device myself, but it was tested on device (6+) and the problem spotted.
What am I missing. Is it auto layout issue?
Ok, I have figured out the issue.
Basically if you face the same problem, just create .xib file for lunch view. Previously it it was image that we needed to add. With iOS8 it is .xib file that needs to be defined in Launch Screen File in General tab.

Cannot view images in Xcode

I seems to be unable to view images in Xcode. I am not talking about when running an app, nor do I mean UIImageViews (that works) or other views with images set (also works) in Interface Builder, I am simply talking about viewing images by clicking on them in the project navigator (in the left pane) and expecting them to show up on the middle/right (just like when editing code).
Has anyone had this problem as well?
The problem is fullscreen mode. If you exit the fullscreen the images is previewed as expected.
Check this menu and be sure you select Preview :

My NSButton with icon has no icon

I have an NSButton in a nib that is set to an icon, and only an icon:
When I run the app, the icon, despite being one of the images provided by AppKit, is missing:
What's going on here? Why isn't my button's icon showing up?
Okay. In my little sample app I just created, I was able to get the icon to appear (took a bit of doing, though). Summed up, you need to change the button type to "Bevel" and increase the height if necessary.
Apparently "Push"-style NSButton types are too narrow to display the icon comfortably.

how do you put a simple banner/image in OS X app window?

In IB, I put an Image View object in app window, and dragged a tiff from the finder into that space, turned off editing, and positioned/sized the image as a header banner. Looked fine in IB, but when built and ran, ImageView object is there only as a background filled box (without my tiff).
Could someone explain what steps I am missing or point me to an existing relevant answer?
Cheers!
PS: By banner I only mean a static image, nothing to do with html, nor iOS.
Have you put the image in an NSURL or CGImage variable? I haven't worked with any of the image frameworks lately but I know that the app needs to know where the image is. That's the first thing I would look at.
I didn't know you could drag an image from the Finder into an NSImageView. What I would do is add the image to the Xcode project, so that it will be added to the built app. Then the name of the image should appear in the list of choices for the image in the IB inspector for the NSImageView.

Resources