我正在使用以下代码捕获视频:
UIImagePickerController *ipc = [[UIImagePickerController alloc] init];
ipc.sourceType = UIImagePickerControllerSourceTypeCamera;
ipc.delegate = self;
//need to handle delegates methods
//
ipc.allowsEditing = YES;
ipc.videoQuality = UIImagePickerControllerQualityTypeMedium;
ipc.videoMaximumDuration = 30.0f; // 30 seconds
//temporary duation of 30 seconds for testing
ipc.mediaTypes = [NSArray arrayWithObject:@"public.movie"];
// ipc.mediaTypes = [NSArray arrayWithObjects:@"public.movie", @"public.image", nil];
[self presentModalViewController:ipc animated:YES];
//this controller allows to record the videos
Run Code Online (Sandbox Code Playgroud)
我可以使用以下代码将录制的视频保存到相册
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
// recover video URL
NSURL *url = [info objectForKey:UIImagePickerControllerMediaURL];
// check if video is …Run Code Online (Sandbox Code Playgroud) 大家好我已经使用以下代码创建了布局
android:layout_height="wrap_content"></TextView>
<EditText android:layout_height="wrap_content"
android:padding="12dip" android:layout_width="wrap_content" android:text="EditText" android:id="@+id/editText1"></EditText>
</TableRow>
</TableLayout>
<TableRow android:layout_width="match_parent" android:id="@+id/tableRow2" android:layout_height="wrap_content">
<TextView android:text="TextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/textView2"></TextView>
<EditText android:text="EditText" android:id="@+id/editText2" android:layout_width="wrap_content" android:layout_height="wrap_content"></EditText>
</TableRow>
<TableRow android:layout_width="match_parent" android:id="@+id/tableRow3" android:layout_height="wrap_content">
<Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</TableRow>
Run Code Online (Sandbox Code Playgroud)
但现在我想设置margin.how我可以使用XML吗?
我想在iphone4中捕获视频,并且在完成时我想存储在iPhone的文档目录中.请帮助.我能够使用UIImagePickerController捕获视频,但无法将其保存到文档目录中.
我正在使用以下代码在屏幕上呈现图像
-(id) init
{
if( (self=[super init] )) {
CGSize winSize = [[CCDirector sharedDirector] winSize];
CCSprite *player = [CCSprite spriteWithFile:@"Player.png" rect:CGRectMake(0, 0, 27, 40)];
player.position = ccp(player.contentSize.width/2, winSize.height/2);
[self addChild:player];
}
return self;
}
Run Code Online (Sandbox Code Playgroud)
当我运行代码后出现错误
continue
2011-07-11 19:25:58.220 testcellapp[441:707] cocos2d: cocos2d v1.0.0-rc3
2011-07-11 19:25:58.229 testcellapp[441:707] cocos2d: Using Director Type:CCDirectorDisplayLink
2011-07-11 19:25:58.407 testcellapp[441:707] cocos2d: OS version: 4.3.1 (0x04030100)
2011-07-11 19:25:58.411 testcellapp[441:707] cocos2d: GL_VENDOR: Imagination Technologies
2011-07-11 19:25:58.415 testcellapp[441:707] cocos2d: GL_RENDERER: PowerVR SGX 535
2011-07-11 19:25:58.418 testcellapp[441:707] cocos2d: GL_VERSION: OpenGL ES-CM 1.1 …Run Code Online (Sandbox Code Playgroud) 我是cocos2d的新手,我创建了一个简单的例子
CGSize winSize = [[CCDirector sharedDirector] winSize];
CCSprite *player = [CCSprite spriteWithFile:@"Player.jpg"
rect:CGRectMake(0, 0, 27, 40)];
player.position = ccp(player.contentSize.width/2, winSize.height/2);
[self addChild:player];
Run Code Online (Sandbox Code Playgroud)
但我不清楚精灵的位置如何管理它