Transform的成员变量Transform的成员函数Time类,获取和时间相关的信息,可用来计算帧速率,调整时间流逝的速度等。Random类,可用来生成随机数,随机点和旋转。Mathf类提供了常用的数学运算Input类是处理输入的接口:
分类:
其他好文 时间:
2014-08-28 18:00:45
阅读次数:
300
新建一个Category,命名为UIColor+Hex,表示UIColor支持十六进制Hex颜色设置。 UIColor+Hex.h文件, #import?<UIKit/UIKit.h>
#define?RGBA_COLOR(R,?G,?B,?A)?[UIColor?colorWithRed:((R)?/?255.0f)?...
分类:
移动开发 时间:
2014-08-28 11:41:29
阅读次数:
260
今天想改一下WebView的背景色,使用了如下两种常规的修改背景色的方法都不行tintWebView.backgroundColor = [UIColor greenColor];或tintWebView.scrollView.backgroundColor = [UIColor greenColo...
分类:
Web程序 时间:
2014-08-28 10:58:09
阅读次数:
238
- (void)addStripe{ [super viewDidLoad]; // self.view.backgroundColor = [UIColor redColor]; // 1.创建一行背景图片 CGFloat rowW = self.view.frame.size.width;//....
分类:
移动开发 时间:
2014-08-27 21:54:28
阅读次数:
364
一个Catalan数的题,打表对每个数都求一次逆元会T,于是问到了一种求阶乘逆元的打表新方法。 比如打一个1~n的阶乘的逆元的表,假如叫inv[n],可以先用费马小定理什么的求出inv[n],再用递推公式求出前面的项。 我们记数字 x 的逆元为f(x) (%MOD)。 因为 n! = (n-...
分类:
其他好文 时间:
2014-08-27 18:09:18
阅读次数:
227
要在C#中使用类型的拓展方法,可在一个类中中通过指定static的方法,将Type通过this方式作为第一个参数传入,如给Random增加一个NextFloat方法 public static class Extension { public static byte[] N...
分类:
其他好文 时间:
2014-08-27 16:00:37
阅读次数:
137
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
UITapGestureRecognizer *doubleTap =[[UITapGestureRecognizer alloc] initWithTarget:self ac...
分类:
其他好文 时间:
2014-08-27 13:09:17
阅读次数:
153
- (void)initSearchbar{
self.wineSearchBar.delegate = self;
[self.wineSearchBar setScopeBarButtonTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], NSForegr...
分类:
移动开发 时间:
2014-08-26 22:59:26
阅读次数:
316
还是去年的时候有同事随口问我在javascript中怎么把小数转换成整数(去掉小数位),当时我回答直接用parseInt。其实那时候也没有仔细考虑这个问题还有没有其他的方法。不过最近在看别人一篇博文里的代码时,发现他这么写代码var random = (Math.random() * 2) | 0;...
分类:
编程语言 时间:
2014-08-26 22:40:26
阅读次数:
243
很适合初学者:第一种方法用while循环。记得while的条件,小心死循环。 public void BuildRandom() { int[] i = new int[10]; Random r = new Random(); ...
分类:
其他好文 时间:
2014-08-26 13:06:06
阅读次数:
141