안 드 로 이 드 가 코드 에 컨트롤 배경 색 을 설정 하 는 네 가지 방법 (RGB 포함)
1935 단어 디자인 모드독학 노트
TextView tText=(TextView) findViewById(R.id.textv_name); // 1 : tText.setTextColor(android.graphics.Color.RED); // // 2 : tText.setTextColor( 0xffff00ff ); //0xffff00ff int , 0x|ff|ff00ff,0x ,ff ,ff00ff , : ffff00ff 8 , ff00ff 6 。 // 3 : tText.setTextColor(android.graphics.Color.parseColor(#87CEFA)) ; // Color ; // 4 : tText.setTextColor( this .getResources().getColor(R.color.red)); /* 。 R.color.red R.string.red R.drawable.red, * , (xml ): * * #FF0000 #FF0000 #FF0000 */