I'm simply calling from my Activity
:
Toast.makeText(this, "This is a toast", Toast.LENGTH_SHORT).show()
But the result is a text aligned on the top of the toast container, not centered inside as it should:
Any ideas on what could be wrong?
I'm simply calling from my Activity
:
Toast.makeText(this, "This is a toast", Toast.LENGTH_SHORT).show()
But the result is a text aligned on the top of the toast container, not centered inside as it should:
Any ideas on what could be wrong?
I managed to fix it. The problem lies in applying the attribute
android:fitsSystemWindows
to the theme of an activity. I found this answer that explains why that should not be done:Just apply the attribute to the topmost
ViewGroup
of the activity (or style it) instead of its theme and the toast will be formatted correctly.