zoukankan      html  css  js  c++  java
  • 改变uilable uibutton等的字体颜色、大小。

    -(void)changeButtonFont:(UIView *)aView withColorFlag:(int) i

    {

        

        if ([aView isKindOfClass:[UILabel class]]) {

            UILabel *lb = (UILabel    *)aView;

            if (i==1) {

                [lb setTextColor:[UIColor whiteColor]];

            }else {

              [lb setFont:[UIFontsystemFontOfSize:13]];  

               [lb setTextColor:[UIColor blackColor]];

             }

            

            [lb setTextAlignment:UITextAlignmentCenter];

            [lb setFont:[UIFontsystemFontOfSize:13]];

            //            [lb setBackgroundColor:[UIColor whiteColor]];

        }

        NSArray *na = [aView subviews];

        NSEnumerator *ne = [na objectEnumerator];

        UIView *subView;

        while (subView = [ne nextObject]) {

            [selfchangeButtonFont:subView withColorFlag:i];

        }

        

        

  • 相关阅读:
    杂项
    hdu 2094
    hdu acm 1004
    android 重装sdk或者系统的时模拟器出现can open ****
    使用Java模拟操作系统高优先级算法
    各种语法解释及用法
    枚举与结构
    闭包
    socket
    异常
  • 原文地址:https://www.cnblogs.com/sgdkg/p/2715511.html
Copyright © 2011-2022 走看看