我有一位用户已从 Samsung Galaxy S6 Edge 升级到 Samsung Galaxy S7 Edge。
我的应用程序能够拖放纸牌图像。
用户表示此功能不适用于 S7 Edge,但适用于 S6 Edge。
拖动有效,这表明 onTouch() 和 onDrag() 有效,但当对象被放下时,它会返回到其原始位置而不是所需位置。
protected void measureDisplay() {
// get info about screen size to determine style of images to use
display = getWindowManager().getDefaultDisplay();
size = new Point();
display.getSize(size);
displayMetrics = new DisplayMetrics();
// get the density of the display
display.getMetrics(displayMetrics);
width = size.x;
height = size.y;
}
private void measureBoard(View v) {
// get the current view width and height
float viewWidth = v.getWidth();
float viewHeight = v.getHeight();
// extract the image offsets inside the view
Matrix matrix = ((ImageView) v).getImageMatrix();
float[] values = new float[9];
matrix.getValues(values);
boardLeft = values[2]; // the X offset
boardRight = viewWidth - boardLeft;
boardTop = values[5]; // the Y offset
boardBottom = viewHeight - boardTop;
cardOffsetW = (boardRight - boardLeft) / 10;
cardOffsetH = (boardBottom - boardTop) / 10;
}
最佳答案
至少可以通过查明用户是否安装了三星的 Game Tuner 来解决幕后显示缩放的一些问题。它会更改任何“游戏”应用程序的分辨率,并且可能会在不打开的情况下进行更改。
要解决问题,请让用户在 Game Tuner 中为您的游戏指定分辨率(他们可以针对每个应用执行此操作)。在这里查看更多信息:DragEventListener not working on Samsung S7 (6.0)
我正在为我的游戏进行更新,如果他们安装了 Game Tuner,它会弹出一条消息。
关于android - 银河 s7 边缘拖放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36073949/