问题
I have created an image button in Google spreadsheet and have assigned function, to perform some action. But this button click is only working on windows and not working on Android mobile sheet or mobile browser. what is a workaround for this issue?
回答1:
Workaround is to use checkboxes(say, in F1) instead of buttons/Images. Then hook your function, that is supposed to run on button click to onEdit() function.
Sample script:
function onEdit(e){
const rg = e.range;
if(rg.getA1Notation() === "F1" && rg.isChecked() && rg.getSheet().getName() === "Sheet1"){
callFunctionAttachedToImage();
rg.uncheck();
}
}
References:
- Class Range
- Event Objects
来源:https://stackoverflow.com/questions/57840757/button-click-is-only-working-on-windows-not-working-on-android-mobile-sheet