1.ScrollView
必需调用setContentSize设置大小,并且ContentSize > Frame,才能出现滚动效果
[self.topMenuScrollView setContentSize:CGSizeMake(1118, 60)];
2.添加html5文件
可以将html文件添加成为 Relative to Group
将html调用的xml 和 images 添加成为Relative to Folder Reference
特别注意:pano2vr_player.js 添加后默认会加入 Complie Sources,需要把它移动到Copy bundle Resources
3.duplicate symbols for architecture i386
注意是否在不同的文件中实现了相同名字的类
4.Objective-C 字符串与数值互相转换
Convert NSString to int
1 | NSString *aNumberString = @"123" ; |
2 | int i = [aNumberString intValue]; |
Convert int to NSString
1 | int aNumber = 123; |
2 | NSString *aString = [ NSString stringWithFormat: @"%d" , aNumber]; |
5.单个文件的编译选项,
-fobjc-arc 开启arc
-fno-objc-arc 不开启arc 6.定时器 NSTimer *countTimer; countTimer= [NSTimer scheduledTimerWithTimeInterval:0.8 target:self selector: @selector(changeAlpha) userInfo:nil repeats:YES]; - (void)changeAlpha{ UIView *temp; for(temp in self.view.subviews) { if(![temp isKindOfClass:[UIImageView class]] && ![temp isKindOfClass:[UILabel class]]) { continue; } if (temp.alpha == 1){ [UIView animateWithDuration:0.8 animations:^(void){ [temp setAlpha:0.5]; }]; } else{ [UIView animateWithDuration:0.8 animations:^(void){ [temp setAlpha:1]; }]; } [UIView commitAnimations]; } }
7.设置imageView透明度反复变化
[UIView animateWithDuration:0.6 delay:0 options:UIViewAnimationOptionAutoreverse|UIViewAnimationOptionRepeat animations:^(void){
UIView *temp;
for(temp in self.view.subviews) {
if([temp isKindOfClass:[UIImageView class]])
{
temp.alpha = 0.5;
}
}
}completion:^(BOOL finished){
// [self star]
}];