当前位置: 编程技术>移动开发
本页文章导读:
▪ipad开发之-图片擦除成效 ipad开发之---图片擦除效果
使用CoreGraphices框架实现的图片擦除效果。如下:
//
// EraseImageView.h
// Eraser
//
// Created by scott.8an@gmail.com on 11-11-7.
// Copyright 2011 LittleWorn. All rights reserved.
//
#impor.........
▪ 关于ScrollView的scrollTo步骤 关于ScrollView的scrollTo方法
在使用ScrollView的scrollTo方法的方法时候总是不能成功。后来发现如果需要使用这个方法必须在ScrollView中post方法是用。比如:
scrollview.post(new Runnable() {
@Override
publ.........
▪ 装配apk到rom 里面 安装apk到rom 里面
1、adb root 切换到root用户
2、adb remount :重新mount分区,让system 分区从只读,变成可读写。获得root权限才可进行。
3、adb push **.apk /system/app/
// 有的安装需要push so文件.........
[1]ipad开发之-图片擦除成效
来源: 互联网 发布时间: 2014-02-18
ipad开发之---图片擦除效果
使用CoreGraphices框架实现的图片擦除效果。如下:
使用CoreGraphices框架实现的图片擦除效果。如下:
//
// EraseImageView.h
// Eraser
//
// Created by scott.8an@gmail.com on 11-11-7.
// Copyright 2011 LittleWorn. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface EraseImageView : UIImageView {
@private
UIImageView *foregroundImageView;
BOOL canErase;
UIImage *backgroundImage;
UIImage *foregroundImage;
}
//init
-(id)initWithFrame:(CGRect)frame
backgroundImage:(UIImage*)bgImage
foregroundImage:(UIImage*)fgImage;
@end
//
// EraseImageView.m
// Eraser
//
// Created by scott.8an@gmail.com on 11-11-7.
// Copyright 2011 LittleWorn. All rights reserved.
//
#import "EraseImageView.h"
@implementation EraseImageView
#pragma mark life cycle
- (void)dealloc {
[super dealloc];
}
- (id)initWithFrame:(CGRect)frame backgroundImage:(UIImage*)bgImage foregroundImage:(UIImage*)fgImage{
self = [super initWithFrame:frame];
if (self) {
// Initialization code.
self.userInteractionEnabled = YES;
self.image = bgImage;
foregroundImageView = [[UIImageView alloc] initWithFrame:frame];
foregroundImageView.userInteractionEnabled = YES;
[foregroundImageView setImage:fgImage];
[self addSubview:foregroundImageView];
[foregroundImageView release];
}
return self;
}
#pragma mark override
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
if ([touch view] == foregroundImageView){
canErase = YES;
}
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
if (canErase) {
CGPoint currentPoint = [touch locationInView:foregroundImageView];
UIGraphicsBeginImageContext(foregroundImageView.frame.size);
[foregroundImageView.image drawInRect:foregroundImageView.bounds];
CGContextClearRect (UIGraphicsGetCurrentContext(), CGRectMake(currentPoint.x, currentPoint.y, 30, 30));
foregroundImageView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
canErase = NO;
}
@end
[2] 关于ScrollView的scrollTo步骤
来源: 互联网 发布时间: 2014-02-18
关于ScrollView的scrollTo方法
在使用ScrollView的scrollTo方法的方法时候总是不能成功。
后来发现如果需要使用这个方法必须在ScrollView中post方法是用。
比如:
否则无法实现。
在使用ScrollView的scrollTo方法的方法时候总是不能成功。
后来发现如果需要使用这个方法必须在ScrollView中post方法是用。
比如:
scrollview.post(new Runnable() {
@Override
public void run() {
scrollview.scrollTo(0, 30);
}
});
否则无法实现。
[3] 装配apk到rom 里面
来源: 互联网 发布时间: 2014-02-18
安装apk到rom 里面
1、adb root 切换到root用户
2、adb remount :重新mount分区,让system 分区从只读,变成可读写。获得root权限才可进行。
3、adb push **.apk /system/app/
// 有的安装需要push so文件。adb push **.so /system/lib
卸载的时候,直接到system/app 下,rm掉相关的apk文件即可。如果有so的导入,那就到system/lib下rm掉对应的so文件。
即可完成
最新技术文章: