0
我想創建字體類和我使用它在Android Studio中創建的字體類型,使用它
public class Fonts extends Activity{
public static Typeface typeface;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Typeface typeface = Typeface.createFromAsset(getAssets(),"fonts/dn.ttf");
}
}
,並用它例如
Typeface typeface = Fonts.typeface;
Button btn_open = (Button)findViewById(R.id.bt_open);
btn_open.setTypeface(typeface);
,但忽略了最低改變!
在manifests.xml Fonts.java是發射活動
我該怎麼辦? 謝謝
https://code.tutsplus.com/tutorials/quick-tip-customize-android-fonts--mobile-1601看看這裏 –
它不是我想創建字體類! – amin