Within XCode 6.1.1 I'm unable to change the font on my label within my storyboard. I can set 'Text' to either 'Plain' or 'Attributed', but then [T] next to Helevetica Neue 17.0 appears grayed out, and it does not do anything when I click it. This happens in all of my projects.
Screenshot here: https://i.imgur.com/3VOSsVn.png
Thank you!
Edit: Unfortunately none of the answers below have answered my question yet. The [T] is unclickable.. it is grayed out so I can't change the Font to custom under there. And while I could go in and enter code to change the font, I would prefer to do it through the GUI.
This problem was driving me crazy - your workaround works for the normal storyboard, but not for the Watch storyboard which has a custom fonts popup.
I finally found this page:
https://github.com/synergy/synergy/issues/4109
It's a bug with using Synergy - I connected a USB mouse to my Mac and when I click the font "T" icon with the USB mouse, it works!!!!
Actually, you have to first select a syntax category in the detail area. You can press CMD+A to select all categories. Then you can click the "T" and select a new font.
See here: https://developer.apple.com/library/ios/recipes/xcode_help-fonts_and_colors_preferences_help/Recipe.html
In the "font", change "system" to "custom”
You can set font for labels in two ways- programmatically and in storyboard.
In your storyboard, you need to click the little T and then select the wanted font.
In your code, assuming you already set the appropriate IBOutlets, you can use something like
[self.theTextLabel setFont:[UIFont boldSystemFontOfSize:17.0]];
Tap on the "T" sign next to the already assigned font, then change "system" to "custom”. Once the settings are on custom the font can be changed as well as it's weight (ie. light, bold...)
I did find a workaround... I can bring up the font menu by crtl-shift-opt-T and change the font there and changes I make are reflected on the page... but the [T] is still still grayed out for some reason.
Related
I am getting the following warning:
"automatically adjusts font requires using a dynamic type text style"
Which I can not get rid of the warning is on main.storyboard.
I have checked every UILabel in the Identity Inspector to make sure the "Automatically Adjusts Font" is unchecked.
Open your storyboard as Source Code
Search for key "adjustsFontForContentSizeCategory"
Check which object has this option and uncheck Dynamic Type checkbox from interface builder.
I just changed Text style to Body & Warning vanishes.
It's Just because
it is dynamic type textStyle
See list of predefined supported dynamic type textStyle -
I had the same problem. Even after I opened the storyboard as source and removed the "adjustsFontForContentSizeCategory" key, saved and cleaned the project it would still show.
So then I:
Cleaned the project
Closed Xcode
Deleted the derived data folder contents
Re-Opened Xcode and rebuilt
It was gone. :)
It seems to have been a bug in Xcode. This is what I did to fix it:
Change the font in the label that showed the error, to a dynamic type, as suggested
Select check box for "Automatically Adjusts Font"
Build and run the project (the error disappears)
Uncheck the "Automatically Adjusts Font" box
Change the font back to the previous setting that caused the error
Rebuild the project
The error is still gone.
If the "Automatically adjusts font" box is checked with a non dynamic font this warning will appear. Either uncheck the box on the offending label or use a dynamic font type.
Open your storyboard, right click storyboard in file navigator.
Search for (command F) and delete instances of
adjustsFontForContentSizeCategory="YES"
In the Storyboard, after uncheck every "Automatically Adjusts Font" in the Attributes Inspector, run shift + command + K and then build your project again. This should clean your project and remove the warning.
Swift 5+, Xcode 11+:
Right-Click the storyboard that's having this issue (Check Issue Navigator if you don't know which)
Go to the Open As option and select Source Code
Replace every adjustsFontSizeToFit="NO" with adjustsFontSizeToFit="YES"
Run your application
Watch the warning go away (And even if you undo step 3)
I got this error for automatic adjusting on a button. But I could not find "Automatic Adjust Font" checkbox on right panel. Get rid of warning by going to source code of .storyboard and deleting "adjustsFontForContentSizeCategory" properties on problematic button solved my problem.
I am having a weird problem in Interface Builder (Xcode 8). Basically, I can't enable (select) accessibility traits; IB is rejecting my attempt.
For example, I have a UILabel which has the "static text" and "user interaction enabled" traits enabled. I can click the "static text" checkbox to disable it. But then when I click it again to re-enable it, the checkbox briefly shows a minus ("-") which then disappears, leaving the checkbox unchecked.
I don't know how to re-enable that checkbox (or any other). Any solutions would be appreciated!
This has happened to me once. Try restarting Xcode.
This was a bug introduced in Xcode 8, that affected inspector properties that map to bit mask properties. This includes iOS accessibility attributes, NSWindow style masks, and popover segue directions.
https://twitter.com/eternalstorms/status/776384102291431424
It's fixed in Xcode 8.3.
I still find the bug in xcode 8 (do they even fix them?) and when i restart xcode i'm able to set one or two of these traits, then the bug reappear...
One way to deal with it is to edit the file "as source code":
in the Project navigator panel right click on the xib file and "Open as -> Source code"
find the block "
as you can see in the above i'm trying to change my textView's font , but it didn't changing i searched some related terms on changing for like this one
and this , but nothing worked for me
i'm also not sure if this is the correct name of my desired font or not
titleTextView.font = UIFont(name: "Myriad-Condensed", size: 25)
even in this site they dont have anything related to my desired font which is Myriad pro Condensed according to storyboard's attribute inspector
anyone faced anything similar to this before ?? or any clue what i should do ? then please let me know
First you need a font to use. Download any of them in you cass its right here : http://ufonts.com/fonts/myriadpro-cond.html
After downloading drag & drop the font file (otf or ttf) into your project
Make sure you check the box next to your target or the font won’t actually get included in your app (even though it’ll probably show in Interface Builder).
Open up the Info.plist . Add a new array of strings to it: “Fonts provided by application”. Add the filenames for each font you want to use as String entries in the array. (That one ttf file you just added to your project )
Now you're good to go , select that font once again like you did in the attached image.
For more detail see this article https://grokswift.com/custom-fonts/
I added my two fonts to my project folder:
I added them to info.plist:
I can not see them in my custom font list in the storyboard:
What have i done wrong?
I know this is a pretty old question, but I ran into the same issue. And the above tips didn't work for me. Apart from the standard checks (present in bundle, restarting XCode, the thing that fixed my issue was that my label text type was marked as "Plain" and hence some fonts were not showing in the dropdown in the Storyboard. As soon as I changed the text type to "Attributed", all the fonts appeared in the dropdown.
Hope this'll help someone stuck with the same issue.
This drop-down box shows the system-wide installed fonts. So you need to install your custom font on your system first so it's appearing in that drop-down box. You can do that by double-clicking it, the FontBook.app opens and asks you whether you want to install the font.
This was a huge headache for me but I simply fixed it by:
I fixed the issue by restarting my Mac.
Then restarting Xcode.
I Installed the font in the system as per DarkDust solution and i am able to see the font in attributed type.
Then i changed the type to plain and i able to see the Custom font in the font types drop down.
Had the same problem but this SO answer by user Saranjith solved it while the other solutions in this thread didn't: Xcode 8 custom font doesn't show up in interface builder
Basically in Font Book select "Computer Fonts" and then hit the + button and re add the Fonts.
This is happened to me after moving to Xcode 11 in Catalina from Xcode 10 in Mojave.
Well, silly mistake on my part, but I didn't realize my font was named something way different from the file name.
Double-clicking the actual font file opened it in the font book, and that showed the actual font name. It was in the dropdown all along.
I solved my problem when i used font name. Do not use file name. I was used like this [UIFont fontWithName:#"appFont" size:17] but it is wrong.
Upload your font file to https://fontdrop.info/ and use the name
My font file name is appFont.ttf but when i uploaded i saw Roboto Regular.
[UIFont fontWithName:#"Roboto Regular" size:17]
Sometime I go to another file and come back, then my custom fonts are arrived. I think this is an issue of Xcode and will be solved in following version.
In my case I just turn the text from plain to attributed then turn it back again to plain then it showed up., hope this help anyone.
I ran into the same issue and fixed with below steps
Closed storyboard
Cleared derived data
Cleaned the project and open the story board
If this is not working then restart the Xcode.
Thanks
For me it was case sensitive issue with the font file name. Not sure if it's always for this reason...
In my case my fonts were in woff2 formats. Although woff2 is supported in iOS, the fonts don't appear or get rendered in Storyboards.
If Xcode showed your custom font before but stopped to do it at some moment, try to readd font files to your project. It solved the problem for me. Other answers weren't helpful.
I'm using xcode 6 with storyboard for ios app development.
I have a problem with UILabel in view controllers in storyboard: the text is simple and inlower case, but when I run the app in the simulator or in the device I see the Label text in UPPERCASE.
Labels have no outlets, and cannot be modified programmatically.
some one has a solution? I'd prefer not using IBOutlet and setting text by code..
I had somewhat similar problem. In my case everything(title, lables, button texts, etc.) was in upper case. I found out that "Localization Debugging" was on, so when I had language on iphone which was not supported by localization, it turned words automatically to upper case. When I disabled it, everything worked fine again.
Just go to "Product > Scheme > Edit Scheme" and there select "Run" and disable "Localization Debugging". (Sorry, I don't have enough reputation to post images, otherwise I would put here screen)
Hope it helps
I answer myself fot other people.
Nothing to do with this strange thing. It seems a xcode bug. Sometimes the labels appears uppercased, other times are ok.
I discover a trick that was using the attributed text in storyboard. in this way it works correctly.
Another way is to use a outlet and setting the uilabel.text by code.
Bye