zoukankan      html  css  js  c++  java
  • IOS7开发~新UI学起(二)

    1、UINavigationBar:

     

     

        NSDictionary* attrs = @{NSForegroundColorAttributeName: [UIColorblackColor],

                                NSFontAttributeName: [UIFontfontWithName:@"AmericanTypewriter"size:0.0],

                                };

        [[UINavigationBar appearancesetTitleTextAttributes:attrs];

        [[UINavigationBar appearancesetTintColor:[UIColorredColor]];

        

        UINavigationBar *navBar = [[UINavigationBaralloc]init];

        navBar.frame = CGRectMake(0,50,32044);

        

        [navBar pushNavigationItem:[[UINavigationItemalloc]initWithTitle:@"Test"]animated:YES];

        [navBar pushNavigationItem:[[UINavigationItemalloc]initWithTitle:@"Test"]animated:YES];

        [navBar pushNavigationItem:[[UINavigationItemalloc]initWithTitle:@"Test"]animated:YES];

        [navBar pushNavigationItem:[[UINavigationItemalloc]initWithTitle:@"Test"]animated:YES];

     

        [navBar setBarStyle:UIBarStyleDefault];

        [navBar setBackgroundImage:[UIImageimageNamed:@"bg.png"]forBarMetrics:UIBarMetricsDefault];

        [self.view addSubview:navBar];

     

        

     

    2、UIProgressView

     

     



    {

        progress = [[UIProgressViewalloc]initWithFrame:CGRectMake(10,100,300,10)];

        [progresssetProgressImage:[UIImageimageNamed:@"bg.png"]];

        [progresssetProgressViewStyle:UIProgressViewStyleBar];

        [progresssetTrackImage:[UIImageimageNamed:@"sss.png"]];

        [self.viewaddSubview:progress];

        

        [NSTimer scheduledTimerWithTimeInterval:1.0target:selfselector:@selector(run)userInfo:nilrepeats:YES]; 

        

    }

     

    -(void) run

    {

        progress.progress +=0.1;

        [progresssetProgress:progress.progressanimated:YES];

    }

     

     

    2、UISearchbar

     

        UISearchBar *searchBar = [[UISearchBaralloc]initWithFrame:CGRectMake(0,20,320,44)];

        [searchBar setBarStyle:UIBarStyleDefault];

        [searchBar setBarTintColor:[UIColorredColor]];

        [searchBar setBackgroundImage:[UIImageimageNamed:@"bg.png"]

                       forBarPosition:UIBarPositionAny

                           barMetrics:UIBarMetricsDefault];

        

        searchBar.showsCancelButton =YES;

        [self.view addSubview:searchBar];

     

  • 相关阅读:
    js如何求一组数中的极值
    五星评分效果 原生js
    省市区三级联动
    jq表头固定
    css垂直居中 两种方法
    node.js grunt文件压缩
    js 定时器
    动态规划---最长公共子序列
    AES,RSA对称加密和非对称加密
    正则表达式学习笔记
  • 原文地址:https://www.cnblogs.com/yingkong1987/p/3343924.html
Copyright © 2011-2022 走看看