5

Is there a way to show a TextView in front of a VideoView?

Macarse
  • 91,829
  • 44
  • 175
  • 230
The Student
  • 27,520
  • 68
  • 161
  • 264

2 Answers2

5

You can stack widgets on the Z-axis using RelativeLayout. Have your VideoView be the first child of the RelativeLayout. Have your TextView be the second child. Have their android:layout_ rules set up such that they overlap in the X/Y coordinate plane. The TextView will appear to float over the VideoView.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • In addiction to the answer: http://stackoverflow.com/questions/2614393/defining-z-order-of-views-of-relativelayout-in-android – The Student Jul 14 '10 at 12:56
0

If a Custom Toast is not enough you can try with a Dialog.

Macarse
  • 91,829
  • 44
  • 175
  • 230
  • the toast would help if it could be completely transparent, showing just the text, and I could show 2 at a time. The transparency part looks like it is possible.. I'm trying here.. – The Student Jul 13 '10 at 20:22
  • I would like to show 2 of them, one in the top (on up key press), and one in the bottom (on down key press). They don't need to show at the same time. But Android dont let me use 2 toasts. When I tried using the same, just reseting the position and text, it works well, but if I press both keys in short time, both the informations will be shown in bottom or top, where it first appear. Any idea to solve this? Was I clear? – The Student Jul 13 '10 at 21:11