zoukankan      html  css  js  c++  java
  • iOS 小技巧总结

    代码版本:

    1  NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"点击注册代表您已经同意我们的《用户协议》"];
    2     NSRange strRange = {14,6};
    3     [str addAttribute:NSForegroundColorAttributeName value:[UIColor colorInSkinWithKey:@"useColor1"] range:strRange];  //设置颜色
    4     [str addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:strRange];
    5 
    6 //因为是   NSMutableAttributedString  所以要使用
    7 
    8 [_radioButton setAttributedTitle:str forState:UIControlStateNormal];

    经常看新手一个一个输入框的收键盘,其实一句话就好了:

    @interface UIView (UITextField)
    - (BOOL)endEditing:(BOOL)force;    // use to make the view or any subview that is the first responder resign (optionally force)
    @end
    [view.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; //删除所有子视图
    
  • 相关阅读:
    继承作业0920
    类与对象
    类和对象基础题
    类和对象数组
    数组
    字符串
    2.1面向对象
    7.1 Java集合概述
    Java动态代理的两种实现方法
    18.5.2动态代理和AOP
  • 原文地址:https://www.cnblogs.com/wudemingiOS/p/4768140.html
Copyright © 2011-2022 走看看