当前位置: 编程技术>移动开发
本页文章导读:
▪UITableViewCell每行中的UIButton轻巧获得cell的IndexPath UITableViewCell每行中的UIButton轻松获得cell的IndexPath
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(0.0, 0.0, 100, 100);
// set the button's target to this table view controller so we can interpr.........
▪ 简略的鼠标跟随一 简单的鼠标跟随一
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Ty.........
▪ Camera 由下到上1 Camera 由上到下1
主Activity,com.android.camera/com.android.camera.Camera.javaCamera继承ActivityBaseActivityBase 使用Util.java 文件的方法: DevicePolicyManager dpm = (DevicePolicyManager) activity.getSystemService( .........
[1]UITableViewCell每行中的UIButton轻巧获得cell的IndexPath
来源: 互联网 发布时间: 2014-02-18
UITableViewCell每行中的UIButton轻松获得cell的IndexPath
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0.0, 0.0, 100, 100); // set the button's target to this table view controller so we can interpret touch events and map that to a NSIndexSet [button addTarget:self action:@selector(checkButtonTapped:event:) forControlEvents:UIControlEventTouchUpInside]; cell.accessoryView = button; - (void)checkButtonTapped:(id)sender event:(id)event { NSSet *touches = [event allTouches]; UITouch *touch = [touches anyObject]; CGPoint currentTouchPosition = [touch locationInView:self.tableView]; NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint: currentTouchPosition]; if (indexPath != nil) { } }
[2] 简略的鼠标跟随一
来源: 互联网 发布时间: 2014-02-18
简单的鼠标跟随一
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>简单的鼠标跟随提示</title> </head> <body> <img src="/images/logo.gif" > <script type="text/javascript"> document.onmousemove = function(e) { var e = e ? e : window.event; var posx = e.clientX; var posy = e.clientY; document.images[0].style.left = posx + "px"; document.images[0].style.top = posy + "px"; } </script> </body> <html>
[3] Camera 由下到上1
来源: 互联网 发布时间: 2014-02-18
Camera 由上到下1
主Activity,com.android.camera/com.android.camera.Camera.java
Camera继承ActivityBase
ActivityBase 使用Util.java 文件的方法:
DevicePolicyManager dpm = (DevicePolicyManager) activity.getSystemService(
Context.DEVICE_POLICY_SERVICE);
获取CameraManager.CameraProxy 实例mCameraDevice。
所有和硬件交互的操作在App层的接口都由mCameraDevice提供。
mCameraDevice.takePicture(a,b); -------- 拍照
mCameraDevice.startPreviewAsync(); --- 预览图片
通过代码追踪
A:拍照流程:
com.android.camera.Camera.java com.android.camera.CameraManager.java android.hardware.Camera.java
mCameraDevice.takePicture(a,b) ----> takePicture(a,b,c,d) ---------> takePicture(shutter, raw, postview, jpeg); 在这个方法里进行Java本地调用。
B:预览图片流程:
com.android.camera.Camera.java com.android.camera.CameraManager.java android.hardware.Camera.java
mCameraDevice.startPreviewAsync() ----> startPreviewAsync(); ---------> startPreview() 在这个方法里进行Java本地调用。
接下来研究JNI部分的实现。
主Activity,com.android.camera/com.android.camera.Camera.java
Camera继承ActivityBase
ActivityBase 使用Util.java 文件的方法:
DevicePolicyManager dpm = (DevicePolicyManager) activity.getSystemService(
Context.DEVICE_POLICY_SERVICE);
获取CameraManager.CameraProxy 实例mCameraDevice。
所有和硬件交互的操作在App层的接口都由mCameraDevice提供。
mCameraDevice.takePicture(a,b); -------- 拍照
mCameraDevice.startPreviewAsync(); --- 预览图片
通过代码追踪
A:拍照流程:
com.android.camera.Camera.java com.android.camera.CameraManager.java android.hardware.Camera.java
mCameraDevice.takePicture(a,b) ----> takePicture(a,b,c,d) ---------> takePicture(shutter, raw, postview, jpeg); 在这个方法里进行Java本地调用。
B:预览图片流程:
com.android.camera.Camera.java com.android.camera.CameraManager.java android.hardware.Camera.java
mCameraDevice.startPreviewAsync() ----> startPreviewAsync(); ---------> startPreview() 在这个方法里进行Java本地调用。
接下来研究JNI部分的实现。
最新技术文章: