1
선형 레이아웃에 프로그래밍 방식으로 TextView를 추가하고 있습니다. 배경 이미지를 볼 수는 있지만 텍스트가 표시되지 않는 이유가 있습니다. 어떤 아이디어? 코드는 다음과 같습니다.TextView에 프로그램을 추가하면 텍스트가 표시되지 않습니다.
TextView pointsTV = new TextView(getApplicationContext());
pointsTV.setText("Test Should Show");
pointsTV.setGravity(Gravity.CENTER);
pointsTV.setTextColor(android.R.color.white);
pointsTV.setPadding(0, 20, 0, 20);
pointsTV.setBackgroundResource(R.drawable.gamesummary_bottom);
pointsTV.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
ll.addView(pointsTV);
그게 전부 였어! pointsTV.setTextColor (ColorStateList.valueOf (Color.WHITE)); 고맙습니다! – Graeme