2014년 11월 5일 수요일

[android] java에서 resource 값 가져오기.


res/values/color.xml파일에 등록된 색상 값 가져오는 방법.


1
2
3
int colorRed = getResources().getColor(R.color.blue);
TextView txtTest = (TextView)findViewById(R.id.txt1);
txtTest.setTextColor(colorRed);

댓글 없음:

댓글 쓰기