这是我的代码,将UIview 30px向下移动,然后向上移动到y = 10,但此动画无效.这是我第一次尝试创建CAKeyframeAnimation,所以任何人都可以帮我正确地编写它.此外,我希望我的对象不要回到原来的地方,但留在动画结束的地方.
CGMutablePathRef thePath = CGPathCreateMutable();
CGPathAddRect(thePath, NULL, CGRectMake(self.logo.frame.origin.x, self.logo.frame.origin.y, self.logo.frame.size.width, self.logo.frame.size.height));
CGPathAddRect(thePath, NULL, CGRectMake(self.logo.frame.origin.x, self.logo.frame.origin.y-30, self.logo.frame.size.width, self.logo.frame.size.height));
CGPathAddRect(thePath, NULL, CGRectMake(self.logo.frame.origin.x, 100, self.logo.frame.size.width, self.logo.frame.size.height));
CAKeyframeAnimation* AniLoc = [CAKeyframeAnimation animationWithKeyPath:@"frame"];
AniLoc.path = thePath;
AniLoc.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
AniLoc.keyTimes= [NSArray arrayWithObjects:[NSNumber numberWithFloat:0.0f],
[NSNumber numberWithFloat:0.3f],
[NSNumber numberWithFloat:1.0f],nil];
AniLoc.duration = 2.0;
CFRelease(thePath);
[self.logo.layer addAnimation:AniLoc forKey:nil];
Run Code Online (Sandbox Code Playgroud) 我期待创建一个包含facebook Javascript API提供的大多数功能的javascript API.
FB.api
FB.init
FB.logout
FB.getLoginStatus
FB.login
FB.ui
Run Code Online (Sandbox Code Playgroud)
我可以在远程网站中嵌入脚本标记,并且需要从该页面到我的服务器执行所有ajax调用.我正在创建一个架构,需要有人帮助完成它的优秀创意.
40px的sp值是多少?还请告诉转换公式.
我试图将psd中存在的字体大小转换为mdpi密度的sp单位,即160 dpi的320*480
我想的话转换成相同数量Ninety Nine to 99 Second to 2nd和Two to 2 等
有谁知道怎么做?
请任何人都可以将此python代码翻译成javascript.
#
def strip_punctuation(s):
#
for c in ',.":;!%$':
#
while s.find(c) is not -1:
#
s.replace(c, '')
Run Code Online (Sandbox Code Playgroud) 我想创建具有特定格式的日期,例如03-20-2010格式为mdY但日期功能不理解此日期并返回错误的日期
$date = date("Y-m-d", strtotime("03-20-2010"));
Run Code Online (Sandbox Code Playgroud)
上面的代码返回错误的日期,它背后的原因是什么以及如何避免错误的结果?我想要日期功能识别的格式很少是"Y/m/d","m/d/Y","F d,Y","M d,Y".
我有一个应用程序,我需要显示从3到1的计数器,然后快速切换到另一个活动.TimerTask会不适合这样做?谁能告诉我一个如何做到这一点的例子?
CountDownTimer工作.显示计时器3秒的代码是.
new CountDownTimer(4000, 1000) {
public void onTick(long millisUntilFinished) {
Animation myFadeOutAnimation = AnimationUtils.loadAnimation(countdown.this, R.anim.fadeout);
counter.startAnimation(myFadeOutAnimation);
counter.setText(Long.toString(millisUntilFinished / 1000));
}
public void onFinish() {
counter.setText("done!");
}
}.start();
Run Code Online (Sandbox Code Playgroud) 我的情况,我需要将所有请求匹配http://mywebsite.com/portfolio/[anyname]到http://mywebsite.com/portfolio.php?username=[anyname].任何人都可以帮我写.htaccess文件.
谢谢
我有两条路线
; category route
resources.router.routes.category.type = "Zend_Controller_Router_Route"
resources.router.routes.category.route = "shopping/:idTwo/:id/*"
resources.router.routes.category.defaults.module = "default"
resources.router.routes.category.defaults.controller = "shopping"
resources.router.routes.category.defaults.action = "category"
resources.router.routes.category.reqs.id = \w+
resources.router.routes.category.reqs.id = \d+
; searchroute
resources.router.routes.search.type = "Zend_Controller_Router_Route"
resources.router.routes.search.route = "shopping/search/:id/*"
resources.router.routes.search.defaults.module = "default"
resources.router.routes.search.defaults.controller = "shopping"
resources.router.routes.search.defaults.action = "search"
resources.router.routes.search.reqs.id = \w+
Run Code Online (Sandbox Code Playgroud)
类别路由必须与http://mrc.localhost/shopping/Childrens-Clothing/98等网址匹配,并且工作正常
搜索路径必须与http://mrc.localhost/shopping/search/dvd+box+set 和http://mrc.localhost/shopping/search/123等网址匹配.
搜索路径适用于没有关键字(:id)作为整数的网址,如http://mrc.localhost/shopping/search/dvd+box+set但如果关键字只是整数,那么类别路由器就像网址一样优先http://mrc.localhost/shopping/search/123,因此调用类别操作而不是搜索操作,因为您看到:idTwo可以是任何字符串,它匹配"搜索"因此使用类别路由但我希望搜索路由是无论什么是关键字,都使用
iphone ×3
php ×3
android ×2
ios ×2
javascript ×2
objective-c ×2
.htaccess ×1
ajax ×1
cross-domain ×1
python ×1
url-routing ×1