How do I solve such warning? What does it mean in most of the cases?
When I click on it, there is nothing highlighted on my Interface Builder (it just zooms in on some area between 2 view controllers).
You have a UIImageView with Highlighted set to true in Xcode. Xcode tells you that the value is for WYSIWYG but won't work at runtime.
After looking at warning message details I got to know, but still there was no way, I could find particular Image is having highlighted="YES"
Perfect Trick suggested by #Keller in Accepted answer's comment.
Just right click your Storyboard --> Open As --> Source Code.
search for
highlighted="YES
Just set YES to NO.
or event if you look carefully code around searched string, you can get in which ViewController's Scene particular ImageView.
Thanks to #Keller
Right click on your Storyboard -> Open as -> Source Code.
Search for highlighted = "YES".
Check the name of the image.
Find the image on the Storyboard.
Click the image, go to Show the Attributes inspector.
Uncheck the Highlighted option
Highlighted image
Related
I'm very new to Xcode (2 days) and so far I'm finding it fairly frustrating. I'm just trying to add an image to my app's ViewController via he Storyboard, but it does not appear on the simulator. Could someone assist me?
if you are trying an example project of XCode, you may find a "Images.xcassets" folder in project. Drag your image into this folder.
then go to storyboard, focus on your "Image View".
in the attributes list, "Image" field, you can choose the image in it's drop-down menu.
the try running in simulator
good luck!
Here are some details on xcode 10.
Edit the story board, create an image view. Wayne stated, add the image you want in the Images.xcassets.
Click on your image view:
Do View -> Inspectors -> Show Attribute Inspector
Select the image:
After loading your image in the " Assets.xcassets" folder you will need to find the "Attributes inspector" under your right side inspectors tab. Focus or click on your "Image view" that you have to place as a holder on the storyboard. On the right tab under the attributes inspector (looks like a down arrow next to the ruler) you can select your image from the drop-down selection. You may also want to change Content mode to Aspect Fit while you are there.
Swift
I want to create a custom icon downloaded from the internet for a UIBarButton. Do I have to do this programmatically or can I some how find a setting via storyboard? If I choose "custom" it doesn't lead to further choosing of custom icons or anything so I'm not really sure what to do here.
I see there is a "Bar Item: Image" section. Is this what I will use?
http://prntscr.com/5x7gn0
Thanks!
Yes, the image (at the end of that link you posted) is where you would select your image. You need to put it into your project first though.
So steps to do:
Drag the image (hopefully it's in PNG format?) into the sidebar in the left and tick the checkbox titled "Copy items if needed" and click finish. Now you should see the image in your project.
Go to that place in interface builder that you have in the link (here: http://prntscr.com/5x7gn0) and select the image you added from the drop down list.
There is another way you can do this; programmatically, but it's slightly trickier. You still do step 1 but then instead of step 2, you can create an outlet to the Bar Button item and set its image like this:
barButtonItem.image = UIImage(named: "imageName.PNG")
If you need any clarification of what I've said, feel free to ask.
Loic
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.
I've got a number of buttons in a view and have assigned a tag number to each for identification in code. I just went back to check one of them, and can't find the field in the Attributes Inspector where I originally assigned the tags. I've tried all my buttons and restarted Xcode, and the result is the same--no tag field.
Here's what my attribute inspector looks like with a (tagged) button selected in the storyboard:
I came upon a recent comment by someone who also couldn't locate the tag field. He also is using Xcode 5.0.2.
Anybody else run into this?
Thanks!
The sections in the attributes inspector can be shown or hidden by clicking on the lines where the words "View", "Control", etc appear. When you rollover the line with these section titles, you'll see the words "show" or "hide" appear on the right edge of the line. Clicking anywhere on the line toggles between the two states.
Where it says view: Move your mouse over to the far right and something should appear that says "Show". Click on it and you'll see the tag identifiers, etc.
I think I've seen this kind of button before, and now I need one.
A button like the one below who's label can be changed to whatever number I need (from 2 to 10 for example).
I have a feeling that this exists by default in iOS SDK but I can't seem to find it.
Does it exist by default or do I have to create it myself?
Thanks!
Its easy to replicate. Add a new RoundRectButton in interface builder, then in the attributes inspector change the type to Custom. Set the BackgroundImage to an image similar to above, and then set the Title to the number. By default the title will centered in the button, but you can use the Inset options in the attributes inspector and nudge the title in and down using the Top and Left inset attributes.
No, it's not a default item as far as I know. You can see all the default items in the Apple Human Interface Guidelines (see "System-Provided Buttons and Icons").