animated:flag completion:completion]; } -(void)presenbackAction:(GYQBaseBarItem *)bar{ //一旦点击返回...fontWithName:@"PingFang-SC-Medium" size:(kAdjustRatio(fontSize))] #define kTextFont(size) [UIFont systemFontOfSize...:(kAdjustRatio(size))] #define kPingFangHeavyFont(fontSize) [UIFont fontWithName:@"PingFang-SC-Heavy..." size:(kAdjustRatio(fontSize))] #define kPingFangNOkAdjustRatioFont(fontSize) [UIFont fontWithName:...@"PingFang-SC-Medium" size:((fontSize))] #define kBoldFont(fontSize) [UIFont fontWithName:@"Helvetica-Bold
替换ViewController生命周期方法 解决获取索引、添加、删除元素越界crash问题 防止按钮重复暴力点击 全局更换控件初始效果 App热修复 App异常加载占位图通用类封装 全局修改导航栏返回按钮...*font = [UIFont fontWithName:@"Zapfino" size:self.font.pointSize]; if (font) { self.font = font...*font = [UIFont fontWithName:@"Zapfino" size:self.font.pointSize]; if (font) { self.font = font...; } return __self; } - (void)mo_AwakeFromNib { [self mo_AwakeFromNib]; UIFont *font = [UIFont...fontWithName:@"Zapfino" size:self.font.pointSize]; if (font) { self.font = font; } } 使用Demo地址
*font; @property (strong, nonatomic) UIFont *subFont; @end @implementation FPSDisplay + (instancetype...fontWithName:@"Menlo" size:14]; if (_font) { _subFont = [UIFont fontWithName:@"Menlo" size...:4]; } else { _font = [UIFont fontWithName:@"Courier" size:14]; _subFont = [UIFont...fontWithName:@"Courier" size:4]; } [self initCADisplayLink]; [[self keyWindow]...addSubview:self.displayLabel]; } -(UIWindow*)keyWindow { UIWindow *foundWindow = nil; NSArray
labelStr.text = @"iOS 在UILabel显示不同的字体和颜色"; labelStr.textColor = [UIColor lightGrayColor]; labelStr.font = [UIFont...blueColor] range:NSMakeRange(0, 4)]; // 设置指定区域字体样式和大小 [newStr addAttribute:NSFontAttributeName value:[UIFont...fontWithName:@"Arial-BoldItalicMT" size:12] range:NSMakeRange(0, 4)]; labelStr.attributedText = newStr...label3]; label3.text = layoutStr; // 获取这段文字的宽和高 CGSize size = [self SizeOfText:layoutStr withFont:[UIFont...size = [text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName, nil
50, 120, 30)]; [scanningLabel setBackgroundColor:[UIColor clearColor]]; [scanningLabel setFont:[UIFont...fontWithName:@"Courier" size: 18.0]]; [scanningLabel setTextColor:[UIColor redColor]]; [scanningLabel...fixed=[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil...action:nil]; [sw addTarget:self action:@selector(handleSwitchFlash:) forControlEvents:UIControlEventValueChanged...]; [myToolBar setItems:[NSArray arrayWithObjects:backButton,fixed,switchButton,nil]]; [myToolBar
setTitleTextAttributes:@{ NSFontAttributeName:[UIFont...fontWithName:@"Helvetica-Bold" size:22],...super viewWillDisappear:animated]; [self.navigationController.navigationBar setBackgroundImage:nil...forBarMetrics:UIBarMetricsDefault];`` [self.navigationController.navigationBar setShadowImage:nil
参考:各种OS中生成UUID的方法 NSString CHelpFunction::stringWithUuid() { CFUUIDRef uuidObj = CFUUIDCreate(nil...*textFont = [UIFont fontWithName: @"Helvetica" size: 60]; UIColor *textColor = [UIColor blackColor];...*currentFont = label.font; UIFont *newFont = [UIFont fontWithName:[NSString stringWithFormat:@"%...options:UIViewAnimationOptionTransitionFlipFromBottom completion:nil...6.6)], [NSValue valueWithCGPoint:CGPointMake(7.7, 8.8)], nil
navLab = [ControlManager text:@"" font:displayFontSize(18.0f) color:[UIColor whiteColor] alingment:1 fontWithName...else { _tableView.bounces = YES; } } II 更改UIButton的图片颜色 应用场景:比如设计给我们的是一张黑色的返回箭头图...nonatomic,weak) UIButton *btn; @end @implementation NoteViw - (UIButton *)btn{ if (_btn == nil...] initWithString:@"可用设备"]; [attributedString addAttribute:NSFontAttributeName value:[UIFont...fontWithName:@"PingFang-SC-Medium" size:11.0f] range:NSMakeRange(0, _titleLable.text.length)];
同时也在target-->Build Phases-->Copy Bundle Resources中将info.plist中添加的字体添加上(确保能找到资源) 找到真实可用的fontName, 代码中使用fontWithName...找到真实可用的fontName,代码中使用fontWithName: size:。...前面的配置做好之后,我们就可以使用了,但是使用fontWithName: size:需要知道字体库的名称,所以我们需要检测是否已经成功导入字体到系统了,我们就打印一下 Fontfamily 来看看我们添加的字体库是否已导入...// 遍历获取字体名称 - (void)printFontName { for(NSString *fontFamilyName in [UIFont familyNames]){...NSLog(@"family:'%@'",fontFamilyName); for(NSString *fontName in [UIFont fontNamesForFamilyName
* font = [UIFont fontWithName:@"这里输入你的字体名字" size:self.font.pointSize]; if (font) { self.font...instancetype)YHBaseInitWithFrame:(CGRect)rect{ id __self = [self YHBaseInitWithFrame:rect]; UIFont... * font = [UIFont fontWithName:@"这里输入你的字体名字" size:self.font.pointSize]; if (font) { self.font...=font; } return __self; } -(void)YHBaseAwakeFromNib{ [self YHBaseAwakeFromNib]; UIFont... * font = [UIFont fontWithName:@"这里输入你的字体名字" size:self.font.pointSize]; if (font) { self.font
preferredFontForTextStyle:UIFontTextStyleCaption2]; //说实话,没看出什么太大的差别 //设置字体和字体大小 + (UIFont *)fontWithName...:(NSString *)fontName size:(CGFloat)fontSize; //返回所有字体的字体家族名称数组 + (NSArray *)familyNames; //按字体家族名称返回字体名称数组...:(CGFloat)fontSize; //设置加粗字体字号大小 + (UIFont *)boldSystemFontOfSize:(CGFloat)fontSize; //设置斜体字号大小 + (UIFont... *)fontWithSize:(CGFloat)fontSize; //通过描述信息返回字体 7.0后可用 + (UIFont *)fontWithDescriptor:(UIFontDescriptor... *)descriptor size:(CGFloat)pointSize NS_AVAILABLE_IOS(7_0); //返回字体的描述信息,7.0后可用 - (UIFontDescriptor *
之前做过字体加粗,代码: [UIFont boldSystemFontOfSize:16.0f] 可是并没有做过斜体加粗的效果。在网上找了很多资料,但都不能两者同时实现。...代码: levelL.font = [UIFont fontWithName:@"Arial-BoldItalicMT" size:32 * IPHONE6_W_SCALE];
UILabel *label = [UILabel new]; label.font = [UIFont fontWithName:@"Helvetica" size:16]; 用UIFont的新...API:+ (UIFont *)monospacedSystemFontOfSize:(CGFloat)fontSize weight:(UIFontWeight)weight; UILabel *...label.font = [UIFont monospacedSystemFontOfSize:16 weight:UIFontWeightRegular];
设置navBar的背景,去掉黑线,试了好长时间,查了好多,这个对我适用 设置navBar上item的颜色,以及nav Title的颜色和字体大小 替换系统返回按钮的图片,设计说自带的太丑,一开始是自定义返回的...[UIColor whiteColor]]; [[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont...fontWithName:[MKCommonData commonNavigationBarFontType] size:20.0], NSForegroundColorAttributeName:...= self; // 侧滑返回,自定义返回按钮后生效,在最顶部设置可以在Push出来的界面都有效 #pragma mark - gestureRecognizer delegate - // 侧滑返回... error:&error]; if (error) { return nil
label.textColor=[UIColor redColor]; [label setBackgroundColor:[UIColor clearColor]]; [label setFont:[UIFont...fontWithName:@"DBLCDTempBlack" size:30]]; label.textAlignment = NSTextAlignmentCenter; [self.sc addSubview...Paste_Image.png [label setFont:[UIFont fontWithName:@"HelveticaNeue-UltraLight" size:50]]; 8.用表做,不用SC...image.png 9 渐渐消失的效果 iOS有私有iPA可以实现这样的效果,不过有可能被拒绝,还是使用UIKit动画比较稳 [UIView beginAnimations:nil context:nil
shadowView的放大缩小 (4)并根据按钮的center和shaowView的center计算出两个间的距离 (5)画虚线shapeLayer, label显示半径大小 7.点击右下角按钮, 返回用户定位..._radiusLb.text = @"当前安全半径:1000米"; _radiusLb.textColor = [UIColor blackColor]; _radiusLb.font = [UIFont...fontWithName:@"PingFangSC-Regular" size:14]; [bottomView addSubview:_radiusLb]; [_radiusLb mas_makeConstraints...self.addressLb.text = @"北京市海淀区新中关购物中心"; self.addressLb.textColor = [UIColor blackColor]; self.addressLb.font = [UIFont...fontWithName:@"PingFangSC-Regular" size:14]; [bottomView addSubview:self.addressLb]; [self.addressLb
这时实际上我们已经将字体添加进了工程中,但是在在使用这个字体时,字体的名字有时和文件名是不一样的,我们需要知道真实的字体名称,通常情况下,我们会讲所有字体名称打印出来: for (NSString * name in [UIFont... familyNames]) { for (NSString * fo in [UIFont fontNamesForFamilyName:name]) { NSLog...(@"%@",fo); } } 5、找到我们需要的字体,如下使用即可: UIFont * font = [UIFont fontWithName:@"yuweij" size:...rootDic = [NSDictionary dictionaryWithContentsOfFile:paths]; //遍历当前所有字体 for (NSString * name in [UIFont...NSArray * fontArray = [rootDic objectForKey:name]; BOOL tip = NO; for (NSString * fo in [UIFont
如果设置好了闹钟,没有停在该页面,而是返回了手机主屏幕或是手机锁屏,当到了闹钟设定的时间,会弹出消息通知。(如果设定的时间是已经过去的时间,页面不会有响应,直到设置正确的时间为止.)...0.2]; label.text=@"00:00:00"; label.textAlignment=NSTextAlignmentCenter; [label setFont:[UIFont...fontWithName:nil size:80]]; _label=label; [self.view addSubview:label]; UILabel * label1...让定时器失效 UIAlertView * alert=[[UIAlertView alloc]initWithTitle:@"提示" message:@"关闭闹钟" delegate:nil...cancelButtonTitle:@"确定" otherButtonTitles:nil]; // [alert addButtonWithTitle:@"确定"];
这些属性都是可选的 EAIntroPage *page2 = [EAIntroPage page]; page2.title = @"This is page 2"; page2.titleFont = [UIFont...fontWithName:@"Georgia-BoldItalic" size:20]; page2.titlePositionY = 220; page2.desc = sampleDescription2...; page2.descFont = [UIFont fontWithName:@"Georgia-Italic" size:18]; page2.descPositionY = 200; page2.
addChildNode:self.textNode]; self.text = [SCNText textWithString:@"首页" extrusionDepth:3]; self.text.font = [UIFont...fontWithName:@"苹果" size:10]; self.text.containerFrame = CGRectMake(-50, -15, 100, 20); self.text.wrapped...)textField{ self.text = [SCNText textWithString:textField.text extrusionDepth:3]; self.text.font = [UIFont...fontWithName:@"苹果" size:10]; self.text.firstMaterial.diffuse.contents = [UIColor greenColor]; self.text.containerFrame
领取专属 10元无门槛券
手把手带您无忧上云