탭 레이아웃의 활동 중 하나에서 텍스트 글꼴을 변경하려고합니다. 맞춤 글꼴을 사용하고 있습니다. 그러나 글꼴이 작동하지 않습니다. 내 수업 중 하나를 위해, 내가 그 탭으로 전환하면 일식 디버거에서 오류가 발생하지만 절대적으로 내 코드에 문제가없는 것처럼 보입니다. 이것은 내가이 탭으로 전환 할 때안드로이드 탭 위젯에서 텍스트 글꼴을 설정하지 않습니까?
public class YearThreeActivity extends Activity{
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
this.setContentView(R.layout.yearthree);
/*without the next three lines the tab view works fine */
TextView tv=(TextView)findViewById(R.id.yearthree_view);//<-- debugger says this assignment is null but which shouldn't be the case as the R class has that in the id subclass.
Typeface font = Typeface.createFromAsset(this.getAssets(), "fonts/Century_Gothic.ttf");
tv.setTypeface(font);
}
가}
그러나이 활동은 그것이 내가에 있었던
public class StatsActivity extends Activity{
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
this.setContentView(R.layout.stats);
TextView tv=(TextView)findViewById(R.id.stats_view);
Typeface font = Typeface.createFromAsset(this.getAssets(), "fonts/Century_Gothic.ttf");
tv.setTypeface(font);
}
}
작동 거의 똑같은 일을하고 실패 코드입니다 이 시간을 확인하십시오. xml 매니페스트 파일, 레이아웃 파일, 모두는 두 파일 모두 동일하지만 첫 번째 파일은 작동하지 않습니다 ... 저는 최후의 수단으로 여기에 있습니다 ... : <
관심이 솔루션 :) – draw