If you look at http://developer.android.com/intl/ko/guide/topics/ui/notifiers/toasts.html,
Toast's default output position is slightly windowed below the screen, which can be replaced by the setGravity(int,int,int) method. Each parameter is sequentially the Gravity constant, the offset of x and the offset of y.
For example, if you want to have toast appear on the left at the top,
toast.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
You can do it in this way. If you want to print a little more to the right, you can increase the value in the second parameter, and if you want to print a little more to the bottom, you can increase the value in the third parameter.
© 2024 OneMinuteCode. All rights reserved.