任务:需要定义一些模块级别的变量(比如命名的常量),而且客户代码无法将其重新绑定;解决方案:#coding = utf-8class _const(object): class ConstError(TypeError): pass def __setattr__(self,name,v...
分类:
其他好文 时间:
2014-10-01 16:48:41
阅读次数:
158
iPhone官方SDK:如何隐藏UINavigationBar隐藏:[self.navigationControllersetNavigationBarHidden:NOanimated:YES];显示:[self.navigationControllersetNavigationBarHidden:YESanimated:YES];隐藏返回键self.navigationItem.hidesBackButton=YES;
分类:
其他好文 时间:
2014-10-01 14:27:31
阅读次数:
123
- (UIViewController*)viewController{ for (UIView* next = [self superview]; next; next = next.superview) { UIResponder* nextResponder = [next...
分类:
其他好文 时间:
2014-09-30 21:36:20
阅读次数:
154
在手机游戏的开发中,滚动是一项非常重要的操作,而cocos2dx中使用的最广泛的就属于TableView了,不过由于cocos2dx的接口比较晦涩,所以需要一个熟悉的过程。本文主要讲解如何使用TableView。 首先当然是创建一个TableView,这比较简单,和其他控件差不多。看看示例代码: self._skillView = cc.TableView:create(cc.size(wi...
分类:
其他好文 时间:
2014-09-30 18:27:09
阅读次数:
295
代码:-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ //切换方法1 //动画效果:左右滑动 //必须有导航器视图才能切换 [self.navigationController pushView...
分类:
其他好文 时间:
2014-09-30 14:54:19
阅读次数:
165
class Temperature(Object): coefficients={'c':(1.0,0.0,-273.15),'f':(1.8,-273.15,32.0),'r':(1.8,0.0,0.0)} def __init__(self,**kwargs): try...
分类:
其他好文 时间:
2014-09-30 14:35:49
阅读次数:
209
1 #coding=utf-8 2 import sublime, sublime_plugin 3 4 class AutoAlignmentCommand(sublime_plugin.TextCommand): 5 def run(self, edit): 6 pr...
分类:
其他好文 时间:
2014-09-29 21:11:21
阅读次数:
234
storyboard之间的切换有三种方法:[self presentViewController:viewControllerToPresentanimated:YES completion:nil];[self.navigationController pushViewController:vie...
分类:
移动开发 时间:
2014-09-29 11:08:47
阅读次数:
181
locationservice使用ios8之前locationservice在应用开启self.locationManager=[[CLLocatonManageralloc]init][self.locationManagerstartUpdatingLocation];在iOS8上需要加上kCLAuthorizationStatusAuthorizedAlways,在app中的info.plist中添加NSLocationAlwaysUsageDescripti..
分类:
移动开发 时间:
2014-09-29 11:00:01
阅读次数:
179
navigationBar导航条可以看做是self.navigationController导航控制器的一个属性,可以直接用点来表示self.navigationController.navigationBar,当然navigationBar自己还有很多属性,比如样式barStyle、背景backgroundColor、frame属性(可以获取宽高这些信息),还可以用setBackgroundImage方法设置背景图片,当然图片多了可以使用clipsToBounds剪裁。...
分类:
移动开发 时间:
2014-09-29 00:37:26
阅读次数:
321