글꼴을 사용자 지정 글꼴로 설정하려고합니다. 글꼴은 "글꼴"이라는 자산 폴더의 하위 폴더에 있습니다. 이것은 onCreate() 함수의 코드입니다. suddendly 말 디버거를 제공 이클립스Android에서 textView의 글꼴을 설정하려면 어떻게해야합니까?
Typeface centuryGothic = Typeface.createFromAsset(this.getAssets(), "fonts/Century_Gothic_Bold.ttf");
TextView tv = (TextView) findViewById(R.id.TitleAct_title);
tv.setTypeface(centuryGothic);
setContentView(tv);
이 순간
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<TextView
android:text="@string/TitleAct_title"
android:id="@+id/TitleAct_title"
android:textColor="#fff"
android:gravity="center_horizontal"
android:background="#347"
android:textSize="15pt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
</LinearLayout>
나는이 문제 아무것도 볼 수 없습니다에서 내 주요의 XML은 "소스를 찾을 수 없습니다." 왜 디버거를 가져오고 "소스를 찾을 수 없습니다"라는 오류가 발생합니까?
"소스"는 무엇을 찾고 있습니까? 때로는 정확히 무엇을 찾고 있는지 알려주므로 적절하게 수정할 수 있습니다. 또한 "fonts/Century_Gothic_Bold.ttf"에 선도 "/"를 추가해 보았습니까? – Jack