내 클래스 onCreate()
함수에서 initFonts()
함수를 통해 텍스트 스타일을 변경할 수 없습니다. 오류는 없지만 아무 일도 일어나지 않습니다. 무한 루프 (1 초 지연) 인 실행 파일을 실행 중입니다. 이게 문제 야?oncreate에서 TextView 스타일을 변경할 수 없습니다.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initFonts();
// Start a load dialog
progressdialog = new ProgressDialog(MainActivity.this);
progressdialog.setTitle("Please wait");
progressdialog.setMessage("Loading...");
progressdialog.setCancelable(false);
progressdialog.show();
// Start updating all lists
runnable = new Runnable() {
public void run() {
updateList();
}
};
// Keep it running
runnable.run();
}
나는 initFonts()
방법의 글꼴을 변경하고 있습니다 :
TextView cur = (TextView)findViewById(R.id.current);
TextView plus = (TextView)findViewById(R.id.plus);
TextView min = (TextView)findViewById(R.id.min);
cur.setTextSize(150);
Typeface font = Typeface.createFromAsset(getAssets(), "font.ttf");
cur.setTypeface(font);
plus.getBackground().setAlpha(45);
min.getBackground().setAlpha(45);
는 어떤 폴더에 있습니다 .. 당신의 font.ttf 파일을 확인하십시오.? – Riser
예 폴더에 – user6827
내 대답을 참조하십시오. – Riser