QuentinZmiro Posted April 21, 2011 Share Posted April 21, 2011 Hello ! Je vous expose mon probleme. J'essaie de changer la font d'une appli (la mienne en loccurence) mais j'ai une erreur qui me dit Typeface cannot be resolved J'ai tapé : package fr.com.uk.co; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class LOLILOL extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView texteView = (TextView) findViewById(R.id.custom_font); Typeface font = Typeface.createFromAsset(getAssets(), "OpTic.ttf"); texteView.setTypeface(font); } } Je ne sais plus quoi faire :( Merci d'avance Link to comment Share on other sites More sharing options...
nbatteur Posted April 22, 2011 Share Posted April 22, 2011 Peut être : import android.graphics.Typeface; ;) Link to comment Share on other sites More sharing options...
Fractal Posted April 22, 2011 Share Posted April 22, 2011 Plus généralement, avec Eclipse, le raccourci clavier Ctrl+Shift+O rajoute automatiquement tous les « import » nécessaires. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.