public static TextView CreateGameOverTextView() { TextView gameOverTextView = new TextView(_context); gameOverTextView.Text = "Game over"; gameOverTextView.TextSize = 48; gameOverTextView.SetTextColor(Color.White); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); layoutParams.SetMargins(ConvertDpToPixels(200), ConvertDpToPixels(150), 0, 0); gameOverTextView.LayoutParameters = layoutParams; gameOverTextView.BringToFront(); return gameOverTextView; }