注意AlertDialog.Builderdialog=newAlertDialog.Builder(MainActivity.this)这里的参数不能写getApplicationContext();否则会报错。publicclassMainActivityextendsActionBarActivity{
@Override
protectedvoidonCreate(BundlesavedInstanceState){
super.onCreate(savedI..
分类:
其他好文 时间:
2014-12-04 06:35:20
阅读次数:
129
/* ARC的判断准则:只要没有强指针指向对象,就会释放对象 1.ARC特点 1> 不允许调用release、retain、retainCount 2> 允许重写dealloc,但是不允许调用[super dealloc] 3> @property的参数 * strong :成员变量是强指针(...
分类:
其他好文 时间:
2014-12-04 00:45:42
阅读次数:
187
有时候我们重写父类的init方法时不注意将init后面的第一个字母写成了小写,在这个方法里面又调用父类的初始化方法(self = [super init];)时会报错,错误信息如下:error:Cannot assign to 'self' outside of a method in the...
分类:
其他好文 时间:
2014-12-03 22:45:04
阅读次数:
109
public class Main { { //构造块(在构造对象时调用,先于构造方法执行) System.out.println("我是构造块!"); } static{ //静态块(在类加载时执行,且只执行一次【在构造块前执行】eg:数据库连接) S...
分类:
编程语言 时间:
2014-12-03 22:44:57
阅读次数:
153
import UIKitclass LableViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() let bodyFontDescriptor = UIFontDes...
分类:
其他好文 时间:
2014-12-03 21:14:04
阅读次数:
164
Android客户端主要代码:
public ImageHttp(Context context) {
super(context);
filePath = context.getCacheDir().getAbsolutePath();
}
public void uploadUserImg(Bitmap bitmap,
IHttpSenderCallBa...
分类:
Web程序 时间:
2014-12-03 17:14:52
阅读次数:
150
关于题中三个控件的简要使用例子。
代码
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// 设置视图背景色
[self.view setBackgroundColor:[UICo...
分类:
其他好文 时间:
2014-12-03 15:52:01
阅读次数:
135
一、度量单位(dp,sp,px)px是Pixels的缩写,是常用的像素单位,对应的是屏幕上的点。在不同分辨率的屏幕上,使用px作为单位的组件尺寸会不一致。相同px的组件,分辨率越大,实际显示尺寸越小dip/dpdp(density-independent pixel)是与密度无关的像素单位,也就是d...
分类:
移动开发 时间:
2014-12-03 12:05:11
阅读次数:
193
通过连续按两次back键,弹出Toast提示再按一次退出功能。关键代码如下:
第一种方式:
/**
* 连续按两次返回键就退出
*/
private int keyBackClickCount = 0;
@Override
protected void onResume() {
super.onResume();
...
分类:
移动开发 时间:
2014-12-03 10:32:53
阅读次数:
179
1、进入网站http://www.dafont.com,选取需要的字体
2、下载字体,解压文件,找到ttf格式文件,这个是我们要导入至工程的。如thirteen_pixel_font.ttf 。
3、导入文件至工程中 点击最后
4、选取工程targets,进入info,找到Custom iOS Target Properties. 点击列表最后一行入口Bundle
versions ...
分类:
其他好文 时间:
2014-12-03 00:31:48
阅读次数:
196