我将const cors = require('cors')({ origin: true });
this.app.use(function (req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET, PUT, POST, PATCH, DELETE, OPTIONS');
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization, Content-Length, X-Requested-With');
res.setHeader("Accept", "application/json");
res.setHeader('Content-Type', 'text/plain');
res.setHeader("Content-type", "application/json")
//intercepts OPTIONS method
if ('OPTIONS' === req.method) {
//respond with 200
res.send(200);
}
else {
//move on
next();
}
});
this.app.use(cors());
放在另一个recyclerview
里面,可以水平滚动,现在我需要一起滚动所有recyclerview
的适配器,我试图用这段代码来滚动onBindViewHolder中的所有回收站,但是不起作用!任何想法 ?
recyclerview