uifont

UITextView font is nil

删除回忆录丶 提交于 2019-12-21 03:10:14
问题 I created a UITextView with a font size of 14 in a storyboard and hooked it up to the detailDescriptionLabel property of my ViewController. This code is in viewDidLoad: self.detailDescriptionLabel.font=[UIFont systemFontOfSize:10]; NSLog(@"text is %@; font is %@", self.detailDescriptionLabel.text, self.detailDescriptionLabel.font); The console output follows: text is Lorem Ipsum; font is (null) Why is the font set to nil? The setFont: is working; the font does shrink. I want to get the font

UILabel font : bold and italic [duplicate]

谁说我不能喝 提交于 2019-12-20 13:37:47
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: How do I set bold and italic on UILabel of iPhone/iPad? I am trying to make UILabel font bold and italic both using system font, but I cant use these both style at a time. so is it possible to make font bold and italic using system font? here is my code, lblTitle.font = [UIFont italicSystemFontOfSize:[UIFont systemFontSize]]; or lblTitle.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize]]; I want my

UILabel font : bold and italic [duplicate]

本秂侑毒 提交于 2019-12-20 13:37:08
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: How do I set bold and italic on UILabel of iPhone/iPad? I am trying to make UILabel font bold and italic both using system font, but I cant use these both style at a time. so is it possible to make font bold and italic using system font? here is my code, lblTitle.font = [UIFont italicSystemFontOfSize:[UIFont systemFontSize]]; or lblTitle.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize]]; I want my

Add Custom Fonts In Xcode 4.1

十年热恋 提交于 2019-12-20 10:43:34
问题 i want to use custom fonts in y application. i have declared the "Fonts provided by the application" in the info.Plist file and set the label.font to the font with name with / without the .TTF extension draged the TTF file in to the project and copied the file to the project created an outlet to the label but still, nothing works. if someone knows what is going on over there i would like to get some help. recently i have noticed the this problem are known @ the 4.1 (xcode version). TNX :) 回答1

Adding a UIFont and looking for the fontfamily crashes with EXC_BAD_ACCESS

不打扰是莪最后的温柔 提交于 2019-12-20 07:32:10
问题 My problem is, that when I add a font which is described here and when I want to retrieve the font family names with [UIFont familyNames] it crashes. I did it the same way described in the example, but for me it doesn't work. This is my stack trace: 0x314b9ebe in CFDictionaryGetValue 0x33d79be4 in copy_localized_value 0x33d79bd4 in CGFontNameTableCopyRootName 0x33d796f2 in CGFontNameTableCreate 0x33d79e86 in CGFontCopyFamilyName 0x3414ca00 in AddFontsFromCGFontAndPath 0x3414cb7e in

System font “Hiragino Sans” is show with clipped ascender and descenders

非 Y 不嫁゛ 提交于 2019-12-19 11:36:12
问题 I need to use the iOS's system font "Hiragino Sans W3" in my app, but no matter which size/style or the UILabel 's dimensions I choose, the font's ascenders and descenders always appear clipped: It seems that this can this fixed by creating a subclass of UILabel and overwriting method textRectForBounds:limitedToNumberOfLines: to return the "correct" value. So the following code... - (CGRect)textRectForBounds:(CGRect)bounds limitedToNumberOfLines:(NSInteger)numberOfLines { CGRect result =

How to change font size for iPhone 4 and IPhone 5 in auto-layout?

杀马特。学长 韩版系。学妹 提交于 2019-12-19 11:24:38
问题 I am trying to change font size of uilabel for iphone 4 and iphone 5 using autolayout and size classes. IB is giving option only for ipad and greater phones like iphone 6 and 6P . If i change font for wR and hR then it changes fonts size for iphone 4 , 5 and 6 which is wrong in my case . Please help me in this regard. 回答1: Unfortunately , Apple Provides minimum consideration for all iPhone's(4,5,6,6p version) Portrait Mode Compact Width - Compact Height or Compact Width - Regular Height . So

Not able to set custom fonts in WatchKit

大憨熊 提交于 2019-12-19 04:14:07
问题 I am trying to set Roboto font and have added as target for watch kit extension, but it is still coming as nil. Can we set custom fonts in watch kit. 回答1: Yes, you can use custom fonts in WatchKit https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/TextandLabels.html 回答2: Its worked for me.. Using following Codes. Add the custom Font to both WatchKit Extension and WatchKit App target Info.plist Now you write the code following way,

UIFont with custom font fails with Nil

南笙酒味 提交于 2019-12-18 13:13:45
问题 I'm trying to add a custom font to my project in Xcode 4.2, but whenever I try to use it, I get a error that the object is nil. I have done the following: 1) Added a row to my .plist 'Fonts provided by application' value: "LCDMono2 Ultra.ttf" 2) Added the font to my Supporting Files and showed it in XCode to verify it was added. 3) Verified using Get Info that the Full Name is "LCDMono2 Ultra" 4) Created the font in my project with: UIFont *myFont = [UIFont fontWithName:@"LCDMono2 Ultra" size

Visual List of iOS Fonts?

微笑、不失礼 提交于 2019-12-18 10:14:42
问题 I am looking for a list of iOS Fonts for iOS 7. I have found the list on Apple's developer site, I am just wondering if anyone knows of a visual list where each font name is typed out in its typeface. I have seen one or two before, but the latest one I have seen was for iOS 5, and much more has been added since then. 回答1: Have you tried iOS Fonts? This gives you a visual of all of the available fonts with the ability to enter your own string of text to see how it would look. This doesn't