Show toast widget underneath a view

后端 未结 6 1781
别那么骄傲
别那么骄傲 2020-11-29 12:05

For those who helped me out earlier regarding this project, thank you very much! My code no longer has any problems, and I made extra tweaks. Now that the app is actually ro

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 13:00

    For your question, as to how to show a toast at a specific position ,you can do this :-

    Toast toast = new Toast();
    toast.setGravity(Gravity.TOP|Gravity.LEFT, 0, 0);
    toast.makeText(getApplicationContextt(),"Text",Toast.LENGTH_SHORT);
    toast.show();
    

    You can make modifications in this like of code to change toast position :-

        toast.setGravity(Gravity.TOP|Gravity.LEFT, 0, 0);
    

提交回复
热议问题