在template.tpl中添加如下代码:function lee_preprocess_node(&$variables) { if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $var...
分类:
其他好文 时间:
2014-06-25 12:30:01
阅读次数:
245
今天推荐一款来自angularjs源码的单元测试辅助库browserTrigger,这是来自于ngScenario的一段代码。主要用户触发浏览器型行为更新ng中scope view model的值。这是angularjs源码中单元测试的使用browserTrigger的实例:it('should s...
分类:
Web程序 时间:
2014-06-25 12:28:40
阅读次数:
242
在express中设置view engine为html,express-partials会导致语法不正确,其实只要做一行代码的改动就可以function renderer(ext){ if(ext[0] !== '.'){ ext = '.' + ext; } //新增一行代码 if(...
分类:
其他好文 时间:
2014-06-25 11:38:09
阅读次数:
183
LinearLayout有两个非常相似的属性:android:gravity与android:layout_gravity。他们的区别在于:android:gravity用于设置View组件的对齐方式,而android:layout_gravity用于设置Container组件的对齐方式。通俗点说就...
分类:
移动开发 时间:
2014-06-25 11:33:38
阅读次数:
215
一、通过View实现自定义视图通过构造函数创建可视界面public class MyView extends View { // Constructor required for in-code creation public MyView(Context context) { super...
分类:
其他好文 时间:
2014-06-25 11:26:33
阅读次数:
269
函数定义使用 func 定义一个函数。调用函数使用他的名字加 上小括号中的参数列表。使用 -> 分隔参数的名字和 返回值类型。函数声明:[html]view plaincopyfuncgreet(name:String,day:String)->String{return"Hello\(name),...
分类:
其他好文 时间:
2014-06-25 11:03:16
阅读次数:
269
语法:[html]view plaincopy{(parameters)->returntypeinstatements}实例:采用函数实现:[html]view plaincopyletnames=["Chris","Alex","Ewa","Barry","Daniella"]funcbackw...
分类:
其他好文 时间:
2014-06-25 11:02:34
阅读次数:
185
-----------android培训、java培训、ios学习型技术博客、期待与您交流! ------------[objc]view plaincopyprint?#import@interfacePerson:NSObject{int_age;intage;int_h...
分类:
其他好文 时间:
2014-06-25 09:44:18
阅读次数:
214
我们在开发注册界面的时候,最后几个注册条件常常容易被系统弹出的键盘遮挡,如下图:
可以看见,邮箱条件被遮挡掉了,怎么解决呢?我是通过UITextField的代理加计算偏移量:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, ty...
分类:
移动开发 时间:
2014-06-25 07:28:37
阅读次数:
232
//MysurfaceView.javapackagecom.example.surfaceview;importandroid.content.Context;importandroid.graphics.Canvas;importandroid.graphics.Color;importandroid.graphics.Paint;importandroid.view.MotionEvent;importandroid.view.SurfaceHolder;importandroid.view.Surfa..
分类:
移动开发 时间:
2014-06-25 06:25:42
阅读次数:
428