Arabic text support for Android Emulator

后端 未结 2 526
执念已碎
执念已碎 2020-12-01 17:45

I would like to display Arabic text in my Android application. I am developing the application for Android 1.6.

Problem is, when i run the application i can only see

相关标签:
2条回答
  • 2020-12-01 18:14

    I've got solution from my friend for the above said prob..

    And sharing the same here..


    If you are having .ttf file then first of all open your project in eclipse and copy .ttf file into the assets folder, which will be in your project hierarchy. and then open .java file where you want to use that font and just follow these steps:-

    First
    Typeface font1;
    TextView txt1;
    EditText edtxt;
    

    Second: In onCreate Method just write down this code.

    /*here fonttype.ttf is the file which was copied in assets folder.*/
    
    font1 =Typeface.createFromAsset(getAssets(),"fonttype.ttf");
    txt1 =(TextView) findViewById(R.id.user_id_txt);
    txt1.setTypeface(font1);
    
    edtx = (EditText) findViewById(R.id.editText);
    edtx.setTypeface(font1);
    

    by this your problem will solve.


    All credits goes to my friend

    0 讨论(0)
  • 2020-12-01 18:24

    you can save the XML file in the UTF-8 format

    0 讨论(0)
提交回复
热议问题