小控件集合

来源:互联网 发布:win7 for mac 安装iso 编辑:程序博客网 时间:2024/06/06 04:42

// 旋转按钮

    UIActivityIndicatorView *alert = [[UIActivityIndicatorView allocinitWithFrame:CGRectMake(100200100100)];

    [alert setColor:[UIColor grayColor]];

    [_window addSubview:alert];

    [alert startAnimating];

    [alert release];

    - (void)startAnimating;

    - (void)stopAnimating;

    - (BOOL)isAnimating;

效果图:

    

     //下弹选择框

    UIActionSheet *sheet = [[UIActionSheet allocinitWithTitle:@"标题" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"buttt" otherButtonTitles:@"button2",@"button3"nil];

    [sheet showInView:_window];

    [sheet release];

效果图:

   

     //左右选择框

    UISegmentedControl *seg = [[UISegmentedControl allocinitWithItems:@[@"aaa"@"aaa"]];

    [seg setFrame:CGRectMake(5010010030)];

    [_window addSubview:seg];

    [seg release];

    

     //滑动选择框

    UISwitch *sw = [[UISwitch allocinitWithFrame:CGRectMake(501505030)];

    [_window addSubview:sw];

    [sw release];

    

     //工具条

    UIToolbar *too = [[UIToolbar allocinitWithFrame:CGRectMake(052832040)];

    [too setBackgroundColor:[UIColor grayColor]];

    [_window addSubview:too];

    [too release];


0 0
原创粉丝点击