问题描述
我想对我的gridView实现一种onHover。 这是我当前的代码:
var request = require('request');
var fs = require('fs');
var http = require('follow-redirects').http;
var axios = require('axios');
var options = {
'method': 'POST','url': 'http://azcaptcha.com/in.PHP?key=key&method=post','headers': {
},formData: {
'file': {
'value': fs.createReadStream('C:/Users/jsonx/Documents/fiverr/captchatest.png'),'options': {
'filename': 'C:/Users/jsonx/Documents/fiverr/captchatest.png','contentType': null
}
}
}
};
//let respondedID;
convertToInt = (x) => {
var converted=parseInt(x[1],10);
return converted;
}
request(options,function (error,response) {
if (error) throw new Error(error);
var respondedID = response.body;
console.log('line 26 '+respondedID);
chainResolve(respondedID);
});
chainResolve = (id) => {
var sid = id.split('|');
var resolvedID=parseInt(sid[1],10)
console.log(parseInt(sid[1],10));
console.log('line 40 '+convertToInt(sid));
var config = {
method: 'get',url: 'http://azcaptcha.com/res.PHP?key=key&action=get&id=resolvedID',headers: { }
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
}
这给了我以下观点:
所以我希望当鼠标放在网格上时,网格中每个单元格的背景都将改变。 有可能吗?
解决方法
GridView
没有用于悬停事件的侦听器。建议您切换为使用RecyclerView
并在视图持有者上调用setOnHoverListener
。以下链接应有帮助: