上代码:
public class MainActivity extends Activity {
ImageView imgView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout....
分类:
移动开发 时间:
2014-08-23 11:19:50
阅读次数:
240
- (instancetype)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { _scrollView = [[UIScrollView alloc] initWith...
分类:
其他好文 时间:
2014-08-22 17:45:09
阅读次数:
229
Adventure of Super Mario
Time Limit: 2 Seconds Memory Limit: 65536 KB
After rescuing the beautiful princess, Super Mario needs to find a way home -- with the princess of course :-) He's ver...
分类:
其他好文 时间:
2014-08-22 16:27:09
阅读次数:
177
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'#最佳实践"""为了避免前面所有的问题,必须考虑到几下几点:~1:应该避免多重继承,可以一些设计模式来代替它~2:super使用必须一致,在类层次结构中,应该在所有地方都使用super或者...
分类:
编程语言 时间:
2014-08-22 12:47:36
阅读次数:
234
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'#当使用多重继承层次结构时,再使用super的时候是非常危险的,主要是因为类的初始化,基类不在__init__中被隐式调用#1滥用super和传统调用#来自jamesknight(http...
分类:
编程语言 时间:
2014-08-21 21:01:54
阅读次数:
257
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'#超类01#它是一个内建类型,用于访问属于某个对象超类特性printsuper##如果已习惯于通过直接调用父类将self作为第一参数来访问的特性,可能会出现混乱#经典方法classM(ob...
分类:
编程语言 时间:
2014-08-21 18:57:04
阅读次数:
310
实现方式:
1. 继承自ViewGroup或Layout ,自定义设置子view的位置、尺寸等
2. 继承自已有的widget View,用于扩展现有组件的功能
3. 继承自View ,完全自定义一个组件
自定义类的构造函数:
public CustomView2(Context context) {//直接在代码中调用时,使用该函数
super(context);
}
p...
分类:
移动开发 时间:
2014-08-21 17:10:54
阅读次数:
268
file权限的主要作用是通过select ....into outfile 写到服务器上具有写权限的目录下,作为文本格式存放,具有权限的目录也就是启动mysql时的用户权限目录。(没有理解)可以将有读权限的文本文件通过load data infile 命令写入到数据库表,如果这些表中存放了很重要的信...
分类:
其他好文 时间:
2014-08-21 13:19:54
阅读次数:
147
答: init中调用super的init方法来初始化自己所包含有的父类信息1.内存分配 内存应该在[Class alloc]的时候就已经分配了,大小和类型应该由对应的Class来决定。而init方法只是进行对象内部各种变量的初始化,同时将retain count加一,表示目前这块内存空间有人在...
分类:
其他好文 时间:
2014-08-21 11:21:44
阅读次数:
167
fromPyQt4importQtGui,QtCoreclassTest(QtGui.QWidget):def__init__(self,items,parent=None):self.app=QtGui.QApplication([])super(Test,self).__init__(paren...
分类:
其他好文 时间:
2014-08-21 11:12:03
阅读次数:
214