• 切小标签圆角 设置导航条字体样式


    切小标签圆角
        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.markLabel.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(5, 5)];
        CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
        maskLayer.frame = self.markLabel.bounds;
        maskLayer.path = maskPath.CGPath;
        self.markLabel.layer.mask = maskLayer; 

     设置导航条字体样式

     [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont boldSystemFontOfSize:20]}];
       字体大小、颜色
     NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                    [UIColor whiteColor],
                                    NSForegroundColorAttributeName, nil];
        [self.navigationController.navigationBar setTitleTextAttributes:attributes];
    进入横屏
    -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
        return (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight);
    }
    -(NSUInteger)supportedInterfaceOrientations {
        return UIInterfaceOrientationMaskLandscapeRight;
    }

      汉字转拼音

        NSMutableString *mutableString = [NSMutableString stringWithString:person.name];
       CFStringTransform((CFMutableStringRef)mutableString, NULL, kCFStringTransformToLatin, false);
        mutableString = (NSMutableString *)[mutableString stringByFoldingWithOptions:NSDiacriticInsensitiveSearch locale:[NSLocale currentLocale]];
    pt: point
    px: 像素

    pt 和 px 的转换

    1.3g 3gs: 1px = 1pt
    2.4s, 5, 5s, 5c, 6, 6s  1pt = 2px
    3.6plus, 6s plus  1pt = 3px

          添加边框 切圆角

     

            text.layer.cornerRadius = 5;

            text.layer.masksToBounds = YES;

             text.layer.borderWidth = 1;

            text.layer.borderColor = [UIColor blueColor].CGColor;

            text.borderStyle = UITextBorderStyleRoundedRect;

     

            点击按钮高亮 

        _button.showsTouchWhenHighlighted = YES;

     

    KVC方法修改textField的placeholder颜色

    textField.placeholder = @"username is in here!";  
    [textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];  
    [textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"]; 

     

     
  • 相关阅读:
    zTree根据json选中节点,并且设置其他节点不可选
    点击一次按钮,发生多次ajax请求
    sublimeText3 中配置sass环境,并将编译后文件保存到指定文件夹
    MD5加密
    c# Http请求之HttpClient
    xml与object 之间的ORM
    wpf和winform的那点区别
    c# http请求ajax页面
    c# https请求
    python爬虫框架Pyspider初次接触
  • 原文地址:https://www.cnblogs.com/OrangesChen/p/5041925.html
Copyright © 2020-2023  润新知