我正在开发一个应用程序,它在应用程序启动时加载视频.当视频播放并从屏幕上移除时,我观察到一个巨大的混蛋.
我的代码如下:
VideoPlayer.m
-(id)initWithVideo: (CGRect)frame file:(NSString *)videoFile
{
if (self = [super initWithFrame:frame])
{
NSArray *file = [videoFile componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"."]];
NSString *moviePath = [[NSBundle mainBundle] pathForResource:[file objectAtIndex:0] ofType:[file objectAtIndex:1]];
if (nil != moviePath)
{
if (nil != theMovie)
{
[theMovie.view removeFromSuperview];
}
theMovie = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]];
theMovie.view.frame = self.bounds;
theMovie.moviePlayer.scalingMode = MPMovieScalingModeAspectFit;
theMovie.moviePlayer.controlStyle = MPMovieControlStyleNone;
theMovie.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
theMovie.moviePlayer.fullscreen = NO;
[self addSubview:theMovie.view];
}
}
return self;
}
Run Code Online (Sandbox Code Playgroud)
请指导我在哪里错过它.
我有一个像这样的数组,x坐标和y坐标形成一个单独的条目.
$polygon = array("10 0", "20 5", "15 15", "22 15");
Run Code Online (Sandbox Code Playgroud)
现在我怎么能将这个数组分成2个不同的数组,这样所有的x坐标都会落入一个数组,所有的y坐标都会落入另一个数组,如下所示:
$x = array(10, 20, 15, 22);
$y = array(0, 5, 15, 15);
Run Code Online (Sandbox Code Playgroud) 我现在根据颜色主题插件配置我自己的 emacs 颜色主题。
我只是找不到如何定义状态栏的颜色(显示当前行号、文件名、模式的位置)。例如,如果您使用 color-theme-jb-simple ,状态栏的颜色可能是 blue4 ,但是我找不到它的定义位置。有人知道吗?
谢谢大家。
我对int值的范围有疑问
int x=2147483647; /*NO Error--this number is the maximum range
of int value no error*/
int y=2147483648; /*Error--one more than the
maximum range of int*/
int z=2147483647+1; /*No Error even though it is one more
than the maximum range value*/
Run Code Online (Sandbox Code Playgroud)
为什么?
我正在尝试使用 System.Web.UI.WebControls.Calender。
但是当我选择任何日期时,它会自动回发。有什么办法可以避免这种行为。
(我没有看到通常的属性 AutoPostback,我将其设置为 False 以避免这种行为)
仅当用户提交表单后,我才需要选定的日期。
注意-我使用的是VS2008
<html>
<head>
<style type="text/css">
canvas { width: 100%; height: 100%; }
</style>
<script>
function init() {
canvas = document.getElementById('canvas');
alert(canvas.width + "x" + canvas.height);
}
</script>
</head>
<body onload="init();">
<canvas id="canvas"> </canvas>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
此代码显示样式之前的大小.它是风格后我需要的尺寸.我怎样才能做到这一点?
我想用PHP发送数百封电子邮件,并增加我在ini_set中使用的执行时间('max_execution_time',10); 但是在发送了30封电子邮件之后,浏览器会显示一个空白页面并且不向所有人发送电子邮件.
我也将限制改为300,600 ..
我的老板不想再听到重构这个词,因为每当他问一个人他在做什么时,他们会回答" 我正在重构! "
我需要找到可以让经理满意的重构的替代描述.Thesaurus.com没有找到任何重构,任何想法,当他问我在做什么时,我应该告诉他什么?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>Drag Feature Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<style type="text/css">
#controls {
width: 512px;
}
#controlToggle {
padding-left: 1em;
}
#controlToggle li {
list-style: none;
}
</style>
<script src="../OpenLayers.js"></script>
<script type="text/javascript">
var map, vectors, controls;
function init(){
map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0?", {layers: 'basic'});
vectors = new OpenLayers.Layer.Vector("Vector Layer");
map.addLayers([wms, vectors]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new …Run Code Online (Sandbox Code Playgroud) java ×2
javascript ×2
php ×2
.net ×1
asp.net ×1
c# ×1
canvas ×1
css ×1
datetime ×1
eclipse ×1
emacs ×1
html ×1
ios ×1
ipad ×1
objective-c ×1
openlayers ×1
refactoring ×1
webforms ×1