上一页 1 ··· 5 6 7 8 9 10 下一页
摘要: Declare data members private1、使数据成员private,保持了语法的一致性,client不会为访问一个数据成员是否需要使用括号进行函数调度,还是不使用括号直接访问成员而纠结。2、使数据成员private,if you use functions to get or s... 阅读全文
posted @ 2015-04-21 22:29 lshs 阅读(362) 评论(0) 推荐(0)
摘要: Prefer pass-by-reference-to-const to pass-by-value1、By default, C++ passes objects to and from functions by value (a characteristic it inherits from ... 阅读全文
posted @ 2015-04-19 17:23 lshs 阅读(241) 评论(0) 推荐(0)
摘要: Make interfaces easy to use correctly and hard to use incorrectly1、That being the case, if they use one incorrectly, your interface is at least parti... 阅读全文
posted @ 2015-04-16 22:23 lshs 阅读(288) 评论(0) 推荐(0)
摘要: Provide access to raw resources in resource-managing classes1、You need a way to convert an object of the RAII class (in this case, tr1::shared_ptr) i... 阅读全文
posted @ 2015-04-15 23:47 lshs 阅读(361) 评论(0) 推荐(0)
摘要: 1、除了内存资源以外,Other common resources include file descriptors, mutex locks, fonts and brushes in graphical user interfaces (GUIs), database connections, ... 阅读全文
posted @ 2015-04-15 22:49 lshs 阅读(217) 评论(0) 推荐(0)
摘要: Never call virtual functions during construction or destruction1、you shouldn't call virtual functions during construction or destruction, because the... 阅读全文
posted @ 2015-04-13 11:08 lshs 阅读(461) 评论(0) 推荐(0)
摘要: 列表视图和适配器的绑定列表视图既可以使用ListView组件,也可以继承ListActivity。显示可以是ArrayAdapter,也可以是游标SimpleCursorAdapter,还可以是继承BaseAdapter展示其它视图。Cursor c = getContentResolver().q... 阅读全文
posted @ 2015-04-13 00:05 lshs 阅读(500) 评论(0) 推荐(0)
摘要: a) 调用Activity的onCreateDialog()方法创建对话框b) 分别在OnDateSetListener的onDateSet()方法和OnTimeSetListener的onTimeSet()事件方法中更改日期和时间。c) 调用Activity的 showDialog()方法显示对话... 阅读全文
posted @ 2015-04-12 23:59 lshs 阅读(1051) 评论(0) 推荐(0)
摘要: Android中的进度条有多种:对话框进度条,标题栏进度条和水平进度条1.对话框进度条a) 覆盖Activity的onCreateDialog()方法,并在其中创建对话框。b) 调用Activity的showDialog()方法,显示进度条对话框。public class MainActivity ... 阅读全文
posted @ 2015-04-12 23:53 lshs 阅读(474) 评论(0) 推荐(0)
摘要: 1.继承TabActivity实现a) 在布局文件中使用FrameLayout列出Tab组件及Tab中的内容组件b) Activity要继承TabActivityc) 调用TabActivity的getTabHost()方法获得TabHost对象d) 通过TabHost创建Tab选项public c... 阅读全文
posted @ 2015-04-12 23:46 lshs 阅读(632) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 下一页