문제

I have the following code:

Log.i("IX GETX and GETY", " " + f.getWidth()-iv.getWidth() + " " + f.getHeight()-iv.getHeight());

I get the following error: The operator - is undefined for the argument type(s) String, int

Both the getWidth and getHeight have the same calculation.

도움이 되었습니까?

해결책

Try wrapping your calculations with parenthesis, as seen below:

Log.i("IX GETX and GETY", " " + (f.getWidth()-iv.getWidth()) + " " + (f.getHeight()-iv.getHeight()));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top