I am new on Xcode and trying to learn Swift. My problem is with the view of the text-file in Simulator
In Main.storyboard the text-file is the centre of the display. However, when I run the IOS Simulator, the right end of the text file doesn't seem in Simulator.
Why does seem like that? What is the problem?
If you are using autolayout you will need to add constraints to make sure anything inside your window adjusts to the size of each device.
Here is an example screenshot where I am adding constraints to the sides of a Text View, make sure you click the red lines around the square and then click 'Add 4 Constraints' to set the constraints on each side.
I suggest you read up on Storyboard and Autolayout before you continue.
Related
New iOS requirements need Apps for iPhone or iPad must be built with the iOS 13 SDK or later and use an Xcode storyboard to provide the app’s launch screen.
But my project is very old and has never used Storyboards. All UI elements are created dynamically using ViewControllers.
I managed to create a storyboard file and set it as a launcher but it has no scenes and I do not know how to proceed. I would like to:
Create a scene where I place only the original launch image inside (hoping that apple still accepts this branding)
If it is possible to just connect my main ViewController with the scene (if that works with dynamical ViewControllers)
If nothing helps than I would need to create a simple scene which has just a bottom bar like my ViewController
I had this exact issue, here's what I did:
Create LaunchScreen.storyboard and set to use it as launch screen
Using the + button in the top-right (this was not an obvious step), add a View Controller into the storyboard
Untick "Use Safe Area Layout Guides" on the right panel if you're getting that error
Tick "Is Initial View Controller"
Then clean and run, for me it just worked. I did have trouble seeing it update though, as discussed here: Launch Screen storyboard not displaying image
I'm just starting out on a new app with Xcode 9 and iOS 11. I placed a Toolbar at the bottom of the view, then added suggested constraints. Inside the toolbar I placed two buttons, "Sites" and "Item".
When I run the application, the toolbar disappears after a second whenever I launch the app.
Any idea what's causing this? How do I fix it? There's currently no code added to it, just the elements I've mentioned.
You are putting the elements on the launch screen instead of the actual first screen of the application.
If you are using the default configuration, search for the storyboard called Main.storyboard and put the items you want to show there.
I am new to programming on the Apple Mac. I have followed a programming guide supplied in the Mac Developer Library to program a basic GUI program called TrackMix. In this program you place a textbox, a vertical slider and a button control on the view window. Initially, on dragging the specific object, say the textbox, to the window, a set of alignment guides (dotted blue lines) would automatically appear on the canvas when the object is dragged over it. I dont know what has happened, but now those guides have disappeared when I execute the same action of dragging objects to the window. When the object being dragged is over the window a small green dot, with a plus sign in it, appears on the bottom of the object. I have carefully retraced my steps to be exactly the same as stated in the Developer Library, but still the problem persist. Have I, perhaps, involuntarily changed some Xcode settings or what? I am at the end of my wits! PS: I am using Xcode 7.
You have to toggle the menu item "Editor > Canvas > Snap To Guides" in Storyboard. I hope that helps
I am not sure whether this will be helpful, but I just had the same problem and the only thing which worked was re-installing Xcode (7.3) and trashing all of the Xcode preferences.
Good luck.
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.
I can't seem to find it. I know xCode 3 had a button to rotate on the view. I want to make the App Landscape. Any idea how?
Open the Attributes inspector from utilities sidebar (Cmd+Alt+4). You'll see the "Orientation" setting there.
You mean the iPhone simulator?
if so, click anywhere on the simulator, the see the menu, select device, you'll see rotate to left, rotate to right.
I am not using an English simulator, so I am not sure about the name of the menu item, but i'm sure you'll be easy to find it.