当前位置: 编程技术>移动开发
本页文章导读:
▪Toast 的几种展示方法 Toast 的几种显示方法
Toast toast = new Toast(this);
ImageView view = new ImageView(this);
view.setImageResource(R.drawable.icon);
toast.setView(view);
toast.show();
//第二种图片加文字
Toast toast = Toast.makeText(this, "lalalal",.........
▪ xcode4.2中为propery重写setter和getter方法会出现警告解决办法 xcode4.2中为propery重写setter和getter方法会出现警告解决方法
xcode4.2中为propery重写setter和getter方法会出现警告:
writable atomic property 'someProperty' cannot pair a synthesized setter/getter with a user defined setter/g.........
▪ 判断装置是否越狱 判断设备是否越狱
NSFileManager *fileManager = [NSFileManager defaultManager];
BOOL result = [fileManager fileExistsAtPath:@"/private/var/lib/apt/"];
......
[1]Toast 的几种展示方法
来源: 互联网 发布时间: 2014-02-18
Toast 的几种显示方法
Toast toast = new Toast(this);
ImageView view = new ImageView(this);
view.setImageResource(R.drawable.icon);
toast.setView(view);
toast.show();
//第二种图片加文字
Toast toast = Toast.makeText(this, "lalalal", Toast.LENGTH_LONG);
View textView = toast.getView();
LinearLayout lay = new LinearLayout(this);
lay.setOrientation(LinearLayout.HORIZONTAL);
ImageView view = new ImageView(this);
view.setImageResource(R.drawable.icon);
lay.addView(view);
lay.addView(textView);
toast.setView(lay);
toast.show();
//自定义位置
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.custom,
(ViewGroup) findViewById(R.id.llToast));
ImageView image = (ImageView) layout
.findViewById(R.id.tvImageToast);
image.setImageResource(R.drawable.icon);
TextView title = (TextView) layout.findViewById(R.id.tvTitleToast);
title.setText("Attention");
TextView text = (TextView) layout.findViewById(R.id.tvTextToast);
text.setText("自定义Toast");
toast = new Toast(getApplicationContext());
toast.setGravity(Gravity.RIGHT | Gravity.TOP, 12, 40);
toast.setDuration(Toast.LENGTH_LONG);
toast.setView(layout);
toast.show();
[2] xcode4.2中为propery重写setter和getter方法会出现警告解决办法
来源: 互联网 发布时间: 2014-02-18
xcode4.2中为propery重写setter和getter方法会出现警告解决方法
xcode4.2中为propery重写setter和getter方法会出现警告:
writable atomic property 'someProperty' cannot pair a synthesized setter/getter with a user defined setter/getter
解决方法之一:在声明propery(nonatomic, ...)中,加入nonatomic
[3] 判断装置是否越狱
来源: 互联网 发布时间: 2014-02-18
判断设备是否越狱
NSFileManager *fileManager = [NSFileManager defaultManager]; BOOL result = [fileManager fileExistsAtPath:@"/private/var/lib/apt/"];
最新技术文章: