代码笔记

作者: 计算机网络技术  发布:2019-11-23

【代码笔记】正在加载,代码笔记

一,效果图。

图片 1

二,代码。

图片 2

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.


    [self showFooter:YES];
}
-(void)showFooter:(BOOL)showFooter
{
    NSLog(@"上拉刷新:加载更多view");

    if(!loadMoreView)
    {
        loadMoreView=[[UIView alloc]init];

        //加载控件
        UIActivityIndicatorView *activeView=[[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];

        [activeView setFrame:CGRectMake(110, 10, 30, 30)];
        [activeView setBackgroundColor:[UIColor clearColor]];
        [loadMoreView addSubview:activeView];
        [activeView startAnimating];


        //文本
        UILabel *loadLabel=[[UILabel alloc]initWithFrame:CGRectMake(140, 10, 150, 30)];
        [loadLabel setTextAlignment:NSTextAlignmentLeft];
        [loadLabel setText:@"正在加载"];
        [loadLabel setTextColor:[UIColor colorWithRed:150/255.00 green:150/255.00 blue:150/255.00 alpha:1.0]];
        [loadLabel setBackgroundColor:[UIColor clearColor]];
        [loadMoreView addSubview:loadLabel];
    }

    [loadMoreView setFrame:CGRectMake(0, 60, 320, 100)];
    [loadMoreView setBackgroundColor:[UIColor clearColor]];

    if(!loadMoreView.superview)
    {
        [self.view addSubview:loadMoreView];
    }
    if(showFooter)
    {
       [loadMoreView setAlpha:1];
    }
    else
    {
       [loadMoreView setAlpha:0];
    }

}

一,效果图。 二,代码。 - (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. [self...

【代码笔记】伸缩式动漫,代码笔记伸缩

一,效果图。

图片 3

二,代码。

图片 4

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    [email protected]"伸缩式动画";
}
//点击任何处,弹出动画
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{

    UIView *zanView = [[UIView alloc] initWithFrame:CGRectMake(50, 100, 100, 100)];
    zanView.backgroundColor = [UIColor redColor];
    [self.view addSubview:zanView];

    [UIView animateWithDuration:0.3 animations:^{
        zanView.transform = CGAffineTransformMakeScale(1.2, 1.2);
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.3 animations:^{
            zanView.transform = CGAffineTransformMakeScale(0.9, 0.9);
        } completion:^(BOOL finished) {
            [UIView animateWithDuration:0.3 animations:^{
                zanView.transform = CGAffineTransformMakeScale(1.0, 1.0);
            } completion:^(BOOL finished) {

            }];
        }];
    }];

}

图片 5

 

 

   

一,效果图。 二,代码。 - (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the vie...

本文由今晚买四不像发布于计算机网络技术,转载请注明出处:代码笔记

关键词:

上一篇:没有了
下一篇:没有了