self.view.backgroundColor=[UIColorwhiteColor];
//UICollectionViewLayout不能直接使用,给collectionView的cell提前布局prepareLayout(重写item的方法)
UICollectionViewFlowLayout*flowLayout=[[UICollectionViewFlowLayoutalloc]init];
//cell的大小item的大小
flowLayout..
分类:
其他好文 时间:
2014-09-22 11:35:23
阅读次数:
149
可以使用AlertDialog.Builder才产生一个提示框首先最简单的是弹出一个消息框:newAlertDialog.Builder(self)
.setTitle("标题")
.setMessage("简单消息框")
.setPositiveButton("确定",null)
.show();效果如下:带确认和取消按钮的对话框:newAlertDialog.Builder(self)
.setT..
分类:
移动开发 时间:
2014-09-22 04:25:32
阅读次数:
218
''' d1=[np.array([i]) for i in spot.tolist()] payoff=[] for i in range(spot.size): d2=self.Payoff(d1[i]) ...
分类:
其他好文 时间:
2014-09-22 02:57:01
阅读次数:
214
#pip??install??tornado
#cat??web.py
import?tornado.ioloop
import?tornado.web
class?MainHandler(tornado.web.RequestHandler):
????def?get(self):
????????self.write(‘hello,world...
分类:
其他好文 时间:
2014-09-21 22:13:51
阅读次数:
324
看斯坦福视频,学到一个觉得不错的编程风格,记录下来 在一个方法中,如果有返回值,可以这样写:1 初始化你想要得到值 2 然后进行操作 设置等 3最后返回。 实例 - (Card*)getRandomCard { Card * card = nil; if (self.card...
分类:
其他好文 时间:
2014-09-21 21:30:21
阅读次数:
187
昨天做了百度的前端笔试题,其中有一个问输出结果的题,感觉有点懵,平时js是用到哪看到哪,没有研究这么深入。现在整理一下。题目:var myObject={foo: "",func: function(){var self = this;console.log("outer func : this.f...
分类:
Web程序 时间:
2014-09-21 19:44:11
阅读次数:
220
Compare methodEither you implement a compare-method for your object:- (NSComparisonResult)compare:(Person *)otherObject { return [self.birthDate co...
分类:
其他好文 时间:
2014-09-20 23:09:39
阅读次数:
263
我这个是在navigationBar上一个搜索框:搜索框不在View上,不能用self.view只能用window上/** * 控制器的View被点击了,就会调用 * * @param touches 对象 * @param event 事件(封装了触摸的所有事件) */- (void)t...
分类:
移动开发 时间:
2014-09-20 16:02:38
阅读次数:
229
loadView
1.什么时候被调用?
每次访问UIViewController的view(比如controller.view、self.view)而且view为nil,loadView方法就会被调用。
2.有什么作用?
loadView方法是用来负责创建UIViewController的view
3.默认实现是怎样的?
默认实现即[super loadView...
分类:
其他好文 时间:
2014-09-20 15:21:59
阅读次数:
150
.h文件:#import @interface YLYTabBar : UIView@end.m文件#import "YLYTabBar.h"@implementation YLYTabBar- (id)initWithFrame:(CGRect)frame{ self = [super in...
分类:
移动开发 时间:
2014-09-20 14:56:58
阅读次数:
230