Oct 31, 2014 - iOS UIProgressView

直接上代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//UIProgressView的使用 常用于歌曲的和下载的进度条
UIProgressView *oneProgressView = [[UIProgressView alloc] init];
oneProgressView.frame = CGRectMake(0, 30, 320, 30); // 设置UIProgressView的位置和大小
oneProgressView.backgroundColor = [UIColor clearColor]; // 设置背景色
oneProgressView.alpha = 1.0; // 设置透明度 范围在0.0-1.0之间 0.0为全透明

oneProgressView.progressTintColor = [UIColor yellowColor]; // 设置已过进度部分的颜色
oneProgressView.trackTintColor = [UIColor blackColor]; // 设置未过进度部分的颜色
oneProgressView.progress = 0.2; // 设置初始值,范围在0.0-1.0之间,默认是0.0
// [oneProgressView setProgress:0.8 animated:YES]; // 设置初始值,可以看到动画效果

[oneProgressView setProgressViewStyle:UIProgressViewStyleDefault]; // 设置显示的样式
// 添加到View上,并释放内存
[self.view addSubview:oneProgressView];
[oneProgressView release], oneProgressView = nil;

Oct 30, 2014 - Segues initiated directly from view controllers must have an identifier

①Warning message from Xcode

waring message

②decription

when the segue type is Modal, the identifier must be setted. if the segue is others, the identifier is not nust.

Oct 28, 2014 - Bind an event handler to the resize

Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.

Put the follow source into your files

1
2
3
4
5
6
7
8
9
10
11
12
13
$(window).resize(function() {
    if(this.resizeTO) clearTimeout(this.resizeTO);
    this.resizeTO = setTimeout(function() {
        $(this).trigger('resizeEnd');
    }, 500);
});

$(window).bind('resizeEnd', function() {
//get the current width
console.log($(this).width());
//get the current height
console.log($(this).height());
});