How to get distance from the View to a phone bottom?
问题 If I have a certain View on the layout ( ImageView , for example), is it possible to find the distance from the bottom border of the View to the bottom of the phone screen? Thanks. 回答1: // instantiate DisplayMetrics DisplayMetrics dm = new DisplayMetrics(); // fill dm with data from current display getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm); // loc will hold the coordinates of your view int[] loc = new int[2]; // fill loc with the coordinates of your view (loc[0] = x,