I'm a beginner in Swift, just started learning how to make iOS apps. I'm using Swift 4. I got into a problem while practicing on how to create a dropdown menu, when I select an option from a dropdown menu, not all text of chosen option is shown.
Please check photos below to get a better idea of what I mean.
As you can see in the second picture, the chosen text is shown like this "Area...umber 1", I want it to show like this "Area Number 1".
Please help and thanks!
You might added constraint for width of label. Please remove it and make it centre horizontal and centre vertical.
Related
I am currently building a project using storyboards and am having an issue when trying to select elements. When I try and click on an element, it selects the element a bit under it, and to select a certain element I have to aim above it. I have disabled the adjustment of scroll view insets, so I am not sure as to why this is happening. I've attached some demonstration photos. Any help is appreciated, Thanks!
Here I am selecting the "Like" Button:
And here I am selecting the image of a palm tree:
I'm doing a the Ray Wanderlich iOS Appprentice and we are right now working with AutoLayout.
I'm asked to add some constraints to the this particular Table View and I can do so.
What I can't do is modify the "Update Frames" behavior. In this particular case, the book asks me to set it to None.
I can tell you that his is not the default behavior because my label has shrunk as per the warning in the book—see attached warning and image.
Note: If you had set Update Frames to “Items of New Constraints”, then Interface Builder would have moved the label to where the dotted
box is. That’s why you left it set to None because you didn’t want it
to do that here.
What can I do to do as the tutorial intends?
So either you click on the round arrow:
or by simply using this shortkey:
Is there an option for a button/image to set, that it will always be shown on top? So I have 2 buttons and want to add an image. But the image covers the two buttons and I have no idea how I could get the image in the background or the buttons in the front.
BTW: I´m fairly new to xcode and programming...
Use the xCode top menu item Editor->Arrange. There you have options to handle z index for controls.
What I did was, to have two button one for the label and one for the image and when one is clicked it propagates the message to the other and does the action depending on which one was clicked.
I was just wondering how I can select all outlets on xcode ios 8. Some of my labels are on top of each other, so I cant select them.
Thanks
Probably the most useful secret trick in Xcode's nib editor is to Shift-Control-click on an interface item in the canvas. This gives a menu where you can select that interface item or anything behind it.
If I understand you correctly, you are trying to select some elements but because they are overlapping you can't get to them.
Click on the box with a line in it as show in the illustration and it will show all your elements and you can select it from their. In previous Xcode versions it was an arrow instead of a line.
Thank you #matt for pointing out, that is called the Document Outline.
What I'm trying to do is simple: bring a label in front of an image within a subview.
But all of the options for arranging are disabled/un-selectable when my label is selected. I find this happens often.
What could be the reason that I'm almost never allowed to change the z-axis of my objects in the Arrange menu? Is it a better practice to avoid this feature and set the order of views programmatically?
It can depend on how you have selected the label (similar to how the label can only be moved with the keyboard when selected in some ways).
A simple alternative is to look at the list of view in the pane on the left and to drag the views up and down to change the order.
It happens sometimes. In that situation, click the view or image you want to send back then you will see little square box at the edges of image from which you can re size your image, Just click on it once and then go to Editor > Arrange > Choose option according your need.