摘要:
IE:有window.event对象FF:没有window.event对象。可以通过给函数的参数传递event对象。如:<input type="button" onmousemove="showDiv(event);"//event不需要加引号function showDiv(event){var event=window.event||event;event.clientX;event.clientY;} 阅读全文
摘要:
You can easily use the JSON (JavaScript Object Notation) data format in client-server communicationswhen writing an iPhone app. This blog is not suggesting that JSON is a more superior format for dataexchange than its counterparts such as XML. In fact, we have many projects that don't use JSON.H 阅读全文
摘要:
/*** url:请求地址* verb:请求方式* parameters:请求参数*/+(NSString *)sendRequestTo:(NSURL *)url usingVerb:(NSString *)verb withParameters:(NSDictionary *)parameters{ NSString *jsonStr = nil; NSData *body = nil; NSMutableString *params = nil; NSString *contentType = @"text/html; charset=utf-8"; NSURL *f 阅读全文
摘要:
Tab选项卡类似与电话本的界面,通过多个标签切换不同的内容,要实现这个效果,首先要知道TabHost,它是一个用来存放多个Tab标签的容器,每一个Tab都可以对应自己的布局,比如,电话本中的Tab布局就是一个线性布局要使用TabHost,首先要通过getTabHost方法获取TabHost的对象,然后通过addTab方法来向TabHost中添加Tab,当然每个Tab在切换时都会产生一个事件,要捕捉这个事件,需要设置TabActivity的事件监听setOnTabChangedListener下面是个小例子:TabTest.java view plaincopy to clipboardprin 阅读全文