我希望我的GestureOverlayView可以检测纯粹的水平和垂直手势.
来自http://android-developers.blogspot.com/2009/10/gestures-on-android-16.html
"orientation"表示下方视图的滚动方向.在这种情况下,列表垂直滚动,这意味着任何水平手势(如action_delete)都可以立即被识别为手势.以垂直笔划开头的手势必须至少包含一个要识别的水平分量.换句话说,简单的垂直线不能被识别为手势,因为它会与列表的滚动冲突.
看起来像一个catch-22,如果android:orientation设置为vertical,我只能进行水平滑动,如果android:orientation设置为水平,我只能进行垂直滑动.我怎样才能解决这个问题?
我刚刚将一个node.js站点部署到了AppFog.当我转到"http:// localhost:8080"时,它在本地工作正常,但当我到达AppFog上的那个时:http://bandwithfriends.aws.af.cm/ 我收到以下Chrome控制台错误:
XMLHttpRequest cannot load http://localhost:8080/socket.io/1/?t=1357769454152. Origin http://bandwithfriends.aws.af.cm is not allowed by Access-Control-Allow-Origin.
Run Code Online (Sandbox Code Playgroud)
服务器代码:
var app = require('http').createServer(handler),
io = require('socket.io').listen(app),
static = require('node-static'); // for serving files
// This will make all the files in the current folder
// accessible from the web
var fileServer = new static.Server('./');
app.listen(process.env.VCAP_APP_PORT || 8080);
io.configure('development', function(){
io.set('transports', ['xhr-polling']);
});
Run Code Online (Sandbox Code Playgroud)
CLIENT CODE index.html: 我包括socket.io,如下所示:
<script src="/socket.io/socket.io.js"></script>
Run Code Online (Sandbox Code Playgroud)
客户端代码script.js:
var url = 'http://localhost:8080';
var socket = io.connect(url);
Run Code Online (Sandbox Code Playgroud)
我该如何解决?